Data Table
Sortable, selectable table with column control.
Generated from the package's public source.
API
Bodycomponent
@solidiom/data-table — Headless sortable data table primitive. Parts: Root (table), Header (thead), HeaderCell (th), Body (tbody), Row (tr), Cell (td).
Body(props: DataTableBodyProps): Element
Props
class?string
children: Element
Cellcomponent
@solidiom/data-table — Headless sortable data table primitive. Parts: Root (table), Header (thead), HeaderCell (th), Body (tbody), Row (tr), Cell (td).
Cell(props: DataTableCellProps): Element
Props
class?string
children: Element
ColumnDefinterface
Column definition model.
Props
accessorKeykeyof T & string— Key to access the row data value.headerstring— Header label or render function.idstring— Unique column identifier.sortable?boolean— Whether this column is sortable. Default: false.
DataTableBodyPropsinterface
Props for the table body (tbody).
Props
class?string
children: Element
DataTableCellPropsinterface
Props for a table cell (td).
Props
class?string
children: Element
DataTableContextValueinterface
Shared reactive state and mutation requests for every DataTable part.
Props
baseIdstring— Generated base ID.columnsAccessor<ColumnDef<T>[]>— Column definitions.modelPortTableModelPort<T> | undefined— Table model port for sorting delegation.requestSelectionChange(ids: Set<string>, details: ChangeDetails<DataTableReason>) => void— Request row selection change.requestSortChange(state: SortState, details: ChangeDetails<DataTableReason>) => void— Request sort state change.requestVisibilityChange(ids: Set<string>, details: ChangeDetails<DataTableReason>) => void— Request column visibility change.rowIdKeystring— Row ID accessor key.rowsAccessor<T[]>— Sorted/processed rows.selectedRowIdsAccessor<Set<string>>— Selected row IDs.selectionModeRowSelectionMode— Row selection mode.sortStateAccessor<SortState>— Current sort state.visibleColumnIdsAccessor<Set<string>>— Visible column IDs.
DataTableHeaderCellPropsinterface
Props for a sortable table header cell (th).
Props
class?stringcolumnIdstring— Column ID this header cell corresponds to.
children: Element
DataTableHeaderPropsinterface
Props for the table header (thead).
Props
class?string
children: Element
DataTableReasontype
Reason for a table state change.
DataTableRootPropsinterface
Props for the data table root.
Props
class?stringcolumnsColumnDef<T>[]— Column definitions.dataT[]— Row data.defaultSelectedRowIds?Set<string>— Default selected row IDs.defaultSortState?SortState— Default sort state for uncontrolled mode.defaultVisibleColumnIds?Set<string>— Default visible column IDs. Defaults to all columns.modelPort?TableModelPort<T>— Table model port for sort delegation.onSelectionChange?(ids: Set<string>, details: ChangeDetails<DataTableReason>) => void— Called when row selection changes.onSortChange?(state: SortState, details: ChangeDetails<DataTableReason>) => void— Called when sort state changes.onVisibilityChange?(ids: Set<string>, details: ChangeDetails<DataTableReason>) => void— Called when column visibility changes.ref?(el: HTMLTableElement) => voidrowIdKey?string— Key in each row used as unique row ID.selectedRowIds?Accessor<Set<string>>— Controlled selected row IDs.selectionMode?RowSelectionMode— Row selection mode. Default: "none".sortState?Accessor<SortState>— Controlled sort state.visibleColumnIds?Accessor<Set<string>>— Controlled visible column IDs.
children: Element
DataTableRowPropsinterface
Props for a table row (tr).
Props
class?stringref?(el: HTMLTableRowElement) => voidrowIdstring— Unique row ID. Used for selection tracking.
children: Element
Headercomponent
@solidiom/data-table — Headless sortable data table primitive. Parts: Root (table), Header (thead), HeaderCell (th), Body (tbody), Row (tr), Cell (td).
Header(props: DataTableHeaderProps): Element
Props
class?string
children: Element
HeaderCellcomponent
@solidiom/data-table — Headless sortable data table primitive. Parts: Root (table), Header (thead), HeaderCell (th), Body (tbody), Row (tr), Cell (td).
HeaderCell(props: DataTableHeaderCellProps): Element
Props
class?stringcolumnIdstring— Column ID this header cell corresponds to.
children: Element
Rootcomponent
@solidiom/data-table — Headless sortable data table primitive. Parts: Root (table), Header (thead), HeaderCell (th), Body (tbody), Row (tr), Cell (td).
Root(props: DataTableRootProps<T>): Element
Props
class?stringcolumnsColumnDef<T>[]— Column definitions.dataT[]— Row data.defaultSelectedRowIds?Set<string>— Default selected row IDs.defaultSortState?SortState— Default sort state for uncontrolled mode.defaultVisibleColumnIds?Set<string>— Default visible column IDs. Defaults to all columns.modelPort?TableModelPort<T>— Table model port for sort delegation.onSelectionChange?(ids: Set<string>, details: ChangeDetails<DataTableReason>) => void— Called when row selection changes.onSortChange?(state: SortState, details: ChangeDetails<DataTableReason>) => void— Called when sort state changes.onVisibilityChange?(ids: Set<string>, details: ChangeDetails<DataTableReason>) => void— Called when column visibility changes.ref?(el: HTMLTableElement) => voidrowIdKey?string— Key in each row used as unique row ID.selectedRowIds?Accessor<Set<string>>— Controlled selected row IDs.selectionMode?RowSelectionMode— Row selection mode. Default: "none".sortState?Accessor<SortState>— Controlled sort state.visibleColumnIds?Accessor<Set<string>>— Controlled visible column IDs.
children: Element
Rowcomponent
@solidiom/data-table — Headless sortable data table primitive. Parts: Root (table), Header (thead), HeaderCell (th), Body (tbody), Row (tr), Cell (td).
Row(props: DataTableRowProps): Element
Props
class?stringref?(el: HTMLTableRowElement) => voidrowIdstring— Unique row ID. Used for selection tracking.
children: Element
RowSelectionModetype
Selection mode for rows.
SortDirectiontype
Sort direction for a column.
SortStateinterface
Current sort state.
Props
columnIdstring | nulldirectionSortDirection
TableModelPortinterface
Port interface for delegating sort computation to an adapter. Following the adapter pattern used by calendar/carousel.