useXDSTableSelection@xds/core · Table

Usage

Table displays structured data in rows and columns with consistent dimensionality. It supports rich cell content, sorting, selection, pagination, and column management through a composable plugin system. Use Table for data sets with uniform structure; for simpler or inconsistent data, consider a list or card layout instead.

Best practices

GuidancePractices
DoUse density and divider variants to match the information density and scanning needs of your data.
DoCompose rich cell content with XDS components like XDSBadge, XDSStatusDot, and XDSAvatar via renderCell.
Don'tUse a table for data without consistent columns — use a list or card layout for heterogeneous content.
Don'tEnable every plugin at once — add only the features your use case requires to keep the interface focused.

Anatomy

ElementDescription
Column HeaderrequiredDisplays titles, sorting controls, and bulk selection.
Body RowsrequiredRows with consistent data structure.
FooterDisplays summary or totals.
Top BarContains title, toolbar, and filters.
Bottom BarContains pagination controls.
Support PanelsDisplays row details in a side panel.

Import

ts
import {useXDSTableSelection} from '@xds/core/Table'

Props

PropTypeDescription
getIsItemSelectedrequired
(item: T) => booleanReturns whether the given item is currently selected.
onSelectItemrequired
(event: {item: T; isSelected: boolean}) => voidCalled when a row checkbox is toggled. isSelected is the new desired state.
onSelectAllrequired
(event: {isAllSelected: boolean}) => voidCalled when the select-all header checkbox is toggled.
getIsAllSelectedrequired
() => booleanReturns whether all selectable items are currently selected.
getIsIndeterminate
() => booleanReturns whether selection is partial (some but not all). Renders the select-all checkbox in indeterminate state.
getIsItemSelectable
(item: T) => boolean (default: () => true)Returns whether a row should show a checkbox. Non-selectable rows render nothing in the selection cell.
getIsItemEnabled
(item: T) => boolean (default: () => true)Returns whether a row checkbox is interactive. Disabled rows show a disabled checkbox.