Skip to main content

V1Table

Used to create a static table of data to easily convey information.

Submit feedback
github
V1 components are not compatible with the flattenTokens hook or the DefaultPropsProvider, nor can they be themed using component-level design tokens.
A future redesign will deliver V2 versions of these components and make them compatible with these features.
import { V1Table } from '@uhg-abyss/web/ui/Table';

Usage

A table is used strictly for HTML markup on the page. It is a static tabular structure containing one or more rows that each contain one or more cells; it is not an interactive widget. Thus, its cells are not focusable or selectable. It organizes information in a way that's easy to scan so that users can look for patterns and develop insights from data.

The table consists of two main parts: a header and a body. Column header names describe the type of content displayed in each column. The column header text uses a medium weight font to differentiate from row text. Each row contains data related to a single entity.

If you want to turn a column or FooterCell into a row header, pass the isRowHeader: true prop to an individual column or cell.

Table overflow scroll

The contents of a table can be made scrollable if there is not enough space to show the entire table at once. To do so, use a wrapper element like in the example below, setting the CSS overflow property to 'auto' and adding a tabindex of 0.

Manual table

If more customization is needed, use the Table sub-components to create each section. This allows for adjustments to the individual sections.

Custom table

If further customization is needed, most styles of Table can be overridden using css.

V1Table Props

Prop NameTypeDefaultDescription
childrenReactNode-The contents of the table component
columnsarray[object]-Array of column data. { name: string, key: string }
highlightRowOnHoverbooleanfalseAdds highlighting of rows on hover
rowsarray[object]-Array of column data. { id: number, [column key]: string }
titlestring-Title of the table

V1Table.Container Props

Prop NameTypeDefaultDescription
childrenReactNode-The contents of the table container component
titlestring-Title of the table

V1Table.TableHeader Props

Prop NameTypeDefaultDescription
childrenReactNode-The contents of the table header component

V1Table.TableHeaderRow Props

Prop NameTypeDefaultDescription
childrenReactNode-The contents of the table header row component

V1Table.Column Props

Prop NameTypeDefaultDescription
childrenReactNode-The contents of the table header column component
isRowHeaderboolean-Whether a column is a row header and should be announced by assistive technology during row navigation.

V1Table.TableBody Props

Prop NameTypeDefaultDescription
childrenReactNode-The contents of the table body component

V1Table.Row Props

Prop NameTypeDefaultDescription
childrenReactNode-The contents of the table row component

V1Table.Cell Props

Prop NameTypeDefaultDescription
childrenReactNode-The contents of the table cell component
isRowHeaderboolean-Whether a cell is a row header and should be announced by assistive technology during row navigation.

V1Table Classes

Class NameDescription
.abyss-table-bodyBody container
.abyss-table-cellCell element
.abyss-table-cell-col-{colNum}-row-{rowNum}Cell element in the given column and row
.abyss-table-cell-expandedCell expanded
.abyss-table-cell-expanded-row-{rowNum}Cell expanded for the given row
.abyss-table-footerFooter
.abyss-table-footer-cellFooter cell
.abyss-table-footer-cell-col-{colNum}Footer cell element in the given column
.abyss-table-footer-rowFooter row
.abyss-table-headHeader container
.abyss-table-header-cell-containerHeader cell container
.abyss-table-header-containerHeader Container
.abyss-table-header-dataHeader Cell Container
.abyss-table-rootTable root element
.abyss-table-rowRow element
.abyss-table-row-{rowNum}Row element with the given number
.abyss-table-row-expandedRow expanded
.abyss-table-row-expanded-row-{rowNum}Row expanded for the given row
.abyss-table-styled-headerHeader Styled Container
.abyss-table-styled-header-col-${colNum}Header styled cell container in the given column

V1Table.Container Classes

Class NameDescription
.abyss-table-rootTable root element

V1Table.TableHeader Classes

Class NameDescription
.abyss-table-headHeader container

V1Table.TableHeaderRow Classes

Class NameDescription
.abyss-table-headerHeader row container

V1Table.Column Classes

Class NameDescription
.abyss-table-styled-headerHeader styled cell container

V1Table.TableBody Classes

Class NameDescription
.abyss-table-bodyBody container

V1Table.Row Classes

Class NameDescription
.abyss-table-rowRow element

V1Table.Cell Classes

Class NameDescription
.abyss-table-cellCell element

V1Table.FooterCell Classes

Class NameDescription
.abyss-table-footer-cellFooter cell element

Like an HTML table element, a WAI-ARIA table is a static tabular structure containing one or more rows that each contain one or more cells; it is not an interactive widget. Thus, its cells are not focusable or selectable. The grid pattern is used to make an interactive widget that has a tabular structure.

However, tables are often used to present a combination of information and interactive widgets. Since a table is not a widget, each widget contained in a table is a separate stop in the page tab sequence. If the number of widgets is large, replacing the table with a grid can dramatically reduce the length of the page tab sequence because a grid is a composite widget that can contain other widgets.

Adheres to the Table WAI-ARIA design pattern.

Keyboard Interactions

KeyDescription
Not ApplicableNot Applicable
Table of Contents