Skip to content

Table

Props

API reference for Table. For usage examples, see the React tab.

Table.Root

NameTypeDefault
childrenReactNode

The elements that make up the table. Includes the TableHeader, TableBody, Columns, and Rows.

compactbooleanfalse

Whether the table uses compact sizing

defaultExpandedKeysIterable<Key>

The initial expanded keys in the collection (uncontrolled).

disabledBehaviorDisabledBehavior'all'

Whether disabledKeys applies to all interactions, or only selection.

disabledKeysIterable<Key>

A list of row keys to disable.

disallowEmptySelectionboolean

Whether the collection allows empty selection.

dragAndDropHooksDragAndDropHooks

The drag and drop hooks returned by useDragAndDrop used to enable drag and drop behavior for the Table.

escapeKeyBehavior"clearSelection" | "none"'clearSelection'

Whether pressing the escape key should clear selection in the table or not.

Most experiences should not modify this option as it eliminates a keyboard user's ability to easily clear selection. Only use if the escape key is being handled externally or should not trigger selection clearing contextually.

expandedKeysIterable<Key>

The currently expanded keys in the collection (controlled).

keyboardNavigationBehavior"arrow" | "tab"'arrow'

Whether keyboard navigation to focusable elements within the cells is via the left/right arrow keys or the tab key.

selectionBehaviorSelectionBehavior'toggle'

How multiple selection should behave in the collection.

selectionModeSelectionMode

The type of selection that is allowed in the collection.

shouldSelectOnPressUpboolean

Whether selection should occur on press up instead of press down.

sortDescriptorSortDescriptor

The current sorted column and direction.

treeColumnKey

The id of the column that displays hierarchical data.

variant"default" | "striped""default"

Visual style variant of the table

Table.Body

NameTypeDefault
children((item: T) => ReactNode) | ReactNode

The contents of the collection.

dependenciesreadonly any[]

Values that should invalidate the item cache when using dynamic collections.

itemsIterable<T>

Item objects in the collection.

renderEmptyState((props: TableBodyRenderProps) => ReactNode)

Provides content to display when there are no rows in the table.

Table.Cell

NameTypeDefault
alignment"center" | "end" | "start""start"

The text alignment of the cell's content

allowsArrowNavigationboolean

Whether the cell should support arrow key navigation even when the containing table uses tab keyboard navigation. Allows users to navigate between cells and rows with arrow keys while focus is on an interactive child element within the cell.

childrenChildrenOrFunction<CellRenderProps>

The children of the component. A function may be provided to alter the children based on component state.

colSpannumber

Indicates how many columns the data cell spans.

focusMode"cell" | "child"

Whether the cell or its first focusable child element should be focused when the cell is focused. Defaults to 'child' in arrow keyboard navigation mode and 'cell' in tab keyboard navigation mode.

textValuestring

A string representation of the cell's contents, used for features like typeahead.

Table.Column

NameTypeDefault
alignment"center" | "end" | "start""start"

The text alignment of the columns's text content

allowsArrowNavigationboolean

Whether the column should support arrow key navigation even when the containing table uses tab keyboard navigation. Allows users to navigate between columns and rows with arrow keys while focus is on an interactive child element within the column header.

allowsSortingboolean

Whether the column allows sorting.

childrenChildrenOrFunction<ColumnRenderProps>

The children of the component. A function may be provided to alter the children based on component state.

defaultWidthColumnSize | null

The default width of the column. This prop only applies when the <Table> is wrapped in a <ResizableTableContainer>.

focusMode"cell" | "child"

Whether the column header or its first focusable child element should be focused when the column header is focused. Defaults to 'child' in arrow keyboard navigation mode and 'cell' in tab keyboard navigation mode.

isRowHeaderboolean

Whether a column is a row header (opens in new tab) and should be announced by assistive technology during row navigation.

maxWidthColumnStaticSize | null

The maximum width of the column. This prop only applies when the <Table> is wrapped in a <ResizableTableContainer>.

minWidthColumnStaticSize | null

The minimum width of the column. This prop only applies when the <Table> is wrapped in a <ResizableTableContainer>.

textValuestring

A string representation of the column's contents, used for accessibility announcements.

widthColumnSize | null

The width of the column. This prop only applies when the <Table> is wrapped in a <ResizableTableContainer>.

Table.Footer

NameTypeDefault
children((item: T) => ReactNode) | ReactNode

The contents of the collection.

dependenciesreadonly any[]

Values that should invalidate the item cache when using dynamic collections.

itemsIterable<T>

Item objects in the collection.

Table.Header

NameTypeDefault
children((item: T) => ReactElement<unknown, string | JSXElementConstructor<any>>) | ReactNode

A list of Column(s) or a function. If the latter, a list of columns must be provided using the columns prop.

columnsIterable<T>

A list of table columns.

dependenciesreadonly any[]

Values that should invalidate the column cache when using dynamic collections.

Table.LoadMoreItem

NameTypeDefault
childrenReactNode

The load more spinner to render when loading additional items.

direction"end" | "start"'end'

The scroll direction that triggers load more. Use 'start' for reversed layouts where older content loads when scrolling toward the top.

isLoadingboolean

Whether or not the loading spinner should be rendered or not.

scrollOffsetnumber1

The amount of offset from the bottom of your scrollable region that should trigger load more. Uses a percentage value relative to the scroll body's client height. Load more is then triggered when your current scroll position's distance from the bottom of the currently loaded list of items is less than or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).

Table.Row

NameTypeDefault
children((item: T) => ReactElement<unknown, string | JSXElementConstructor<any>>) | ReactNode

The cells within the row. Supports static items or a function for dynamic rendering.

columnsIterable<T>

A list of columns used when dynamically rendering cells.

dependenciesreadonly any[]

Values that should invalidate the cell cache when using dynamic collections.

disabledBehaviorDisabledBehavior

Whether disabledKeys applies to all interactions, or only selection.

downloadstring | boolean

Causes the browser to download the linked URL. A string may be provided to suggest a file name. See MDN (opens in new tab).

hasChildItemsboolean

Whether this row has children, even if not loaded yet.

hrefstring

A URL to link to. See MDN (opens in new tab).

hrefLangstring

Hints at the human language of the linked URL. SeeMDN (opens in new tab).

isDisabledboolean

Whether the row is disabled.

pingstring

A space-separated list of URLs to ping when the link is followed. See MDN (opens in new tab).

referrerPolicyHTMLAttributeReferrerPolicy

How much of the referrer to send when following the link. See MDN (opens in new tab).

relstring

The relationship between the linked resource and the current page. See MDN (opens in new tab).

routerOptionsundefined

Options for the configured client side router.

targetHTMLAttributeAnchorTarget

The target window for the link. See MDN (opens in new tab).

textValuestring

A string representation of the row's contents, used for features like typeahead.

Table.SelectionCell

NameTypeDefault
allowsArrowNavigationboolean

Whether the cell should support arrow key navigation even when the containing table uses tab keyboard navigation. Allows users to navigate between cells and rows with arrow keys while focus is on an interactive child element within the cell.

colSpannumber

Indicates how many columns the data cell spans.

focusMode"cell" | "child"

Whether the cell or its first focusable child element should be focused when the cell is focused. Defaults to 'child' in arrow keyboard navigation mode and 'cell' in tab keyboard navigation mode.

textValuestring

A string representation of the cell's contents, used for features like typeahead.

Table.SelectionColumn

NameTypeDefault
allowsArrowNavigationboolean

Whether the column should support arrow key navigation even when the containing table uses tab keyboard navigation. Allows users to navigate between columns and rows with arrow keys while focus is on an interactive child element within the column header.

defaultWidthColumnSize | null

The default width of the column. This prop only applies when the <Table> is wrapped in a <ResizableTableContainer>.

focusMode"cell" | "child"

Whether the column header or its first focusable child element should be focused when the column header is focused. Defaults to 'child' in arrow keyboard navigation mode and 'cell' in tab keyboard navigation mode.

maxWidthColumnStaticSize | null

The maximum width of the column. This prop only applies when the <Table> is wrapped in a <ResizableTableContainer>.

minWidthColumnStaticSize | null

The minimum width of the column. This prop only applies when the <Table> is wrapped in a <ResizableTableContainer>.

textValuestring

A string representation of the column's contents, used for accessibility announcements.

widthColumnSize | null

The width of the column. This prop only applies when the <Table> is wrapped in a <ResizableTableContainer>.