sheengemologic ui
All components

DataTable

Virtualized continuous or paginated data with phone cards, selection, layouts, groups, and trees.@gemologic/sheen-table · data

Playground

This example has no scalar controls. Its validated source remains interactive below.
Accounts
not sorted
not sorted
Alpha12
Beta34
Alpha
Amount
12
Beta
Amount
34
<DataTable data={rows} columns={columns} getRowId={row => row.id} caption="Accounts" pagination={false} mobileLayout={{ pageSize: 20, titleColumn: "name" }} initialViewportHeight={160} />

Variant matrix

Bounded continuous data
Accounts
not sorted
not sorted
Alpha12
Beta34
Alpha
Amount
12
Beta
Amount
34

Anatomy

Package
@gemologic/sheen-table
Source
packages/table/src/DataTable.tsx
Tokens
  • --sheen-table-row-h
  • --sheen-color-border
  • --sheen-color-bg
  • --sheen-color-bg-raised

Accessibility

Role: table or treegrid, row, gridcell, columnheader, list, listitem, checkbox, toolbar, menu, separator, navigation, statusKeyboard: Tab, Shift+Tab, Shift+F10, ContextMenu, ArrowLeft, ArrowRight, ArrowUp, ArrowDown, Home, End, PageUp, PageDown, Enter, Space, Shift+Space, Control+A, Meta+A

Do

  • Use continuous client mode for bounded local datasets.
  • Use numbered server pagination for large or expensive remote results.
  • Enable mobileLayout when a table must be functional on phones; tune its bounded continuous page size to row complexity.
  • Supply full-query counts and aggregates when the server delegates grouping.
  • Provide initialResult when server rendering already fetched the accepted page.
  • Define row actions once so context, card overflow, and bulk paths cannot drift.
  • Return complete server exports from onExport rather than walking pages in the component.
  • Return explicit conflict results from onCellCommit instead of parsing transport error text.
  • Change selection.resetKey, hierarchy.resetKey, export.resetKey, and editResetKey when the user's authorization or account boundary changes.
  • Keep column controls enabled when users can drag, so every layout action has a keyboard path.

Do not

  • Do not use pagination=false for an incomplete server response or infinite fetching.
  • Do not render an unbounded phone card list; mobileLayout limits continuous pages to at most 100 cards.
  • Do not calculate group totals from one server page.
  • Do not paginate, sort, filter, or export one server page locally and present it as the complete query.
  • Do not materialize all-matching selection by walking server pages or offer it for a hierarchy whose subtree query cannot be represented.
  • Do not request server data for visibility, order, pin, or width-only changes.

Generated props

NameTypeDefaultDescription
mode"client" | "server"clientClient processes complete supplied data; server delegates the full query and requires pagination plus onStateChange.
datareadonly Row[]Complete bounded client dataset. Available only in client mode.
initialResultDataTableResult<Row>Optional authoritative server result used for SSR without a duplicate hydration request. Delegated grouping includes groups for the accepted page.
onStateChange(state: TableState, signal: AbortSignal) => Promise<DataTableResult<Row>>Server request adapter receiving complete state and an AbortSignal. Available only in server mode.
onExport(request: TableExportRequest, signal: AbortSignal) => Promise<Blob>Optional server adapter returning a Blob for the captured accepted state and immutable selection. Server export UI is hidden without it.
columns *SheenColumns<Row>Opaque column definitions returned by defineColumns.
getRowId *(row: Row) => stringReturns a stable, unique, nonempty row ID.
caption *stringRequired accessible table caption, visually hidden by default.
variantDataTableVariantStandalone frame or application-pane integration; omission follows context.
densityDataTableDensityOptional table-local compact, comfortable, or spacious density. Omission inherits the surrounding application density.
paginationTablePaginationFalse selects complete continuous results; page state selects numbered pagination. Client defaults false and server requires an explicit choice.
initialStateDataTableInitialStateOptional initial query and column-layout state; pagination remains configured by the pagination prop.
filterFilterNodeOptional app-owned accepted filter applied reactively without remounting retained rows; onAcceptedStateChange synchronizes table-authored changes.
rowHeightstringvar(--sheen-table-row-h)CSS length for the fixed row block size or the minimum measured variable-row size.
variableRowHeightbooleanfalseAllows content-driven row heights and measures each realized row.
estimatedRowHeightnumber34Positive CSS-pixel estimate used before measurement. Defaults to the active compact, comfortable, or spacious row token.
initialViewportHeightnumber400Positive CSS-pixel viewport size used for deterministic server rendering and hydration.
classstringOptional class merged onto the table region.
onAcceptedStateChange(state: TableState) => voidReceives accepted query states and locally committed layout states; transient resize frames are excluded.
onRowActivate(row: Row) => voidEnables roving row focus and receives Enter activation for the focused row.
selectionDataTableSelectionOptions<Row>Enables table-owned multiple selection, optional authorization-boundary resetKey, and immutable explicit-ID or query/exclusion payloads.
actionsreadonly DataTableAction<Row>[]One validated action model rendered in the bottom selection bar and each accepted row's context menu.
mobileLayoutboolean | DataTableMobileLayoutOptionsOpt-in card presentation below 768px. Continuous results use local bounded pages of 20 cards by default; numbered tables keep their configured page.
groupingDataTableGroupingOptionsGroups a complete continuous client view, or validates explicit full-query group metadata supplied with each delegated server page.
hierarchyDataTableHierarchyOptions<Row>Provides synchronous children and optional app-loaded subtrees with independent cancellation, retry, stale-response rejection, and authorization reset.
searchfalse | DataTableSearchOptionsConfigures automatic search over explicitly searchable columns, or false disables it; options supply label, placeholder, debounce, shortcut, and an opt-in Exact mode that matches a literal phrase within one searchable column.
filterBarboolean | DataTableFilterBarOptionstrueShows typed filters declared by columns; options may inject an isolated date editor without adding it to the table bundle.
columnControlsbooleantrueShows the keyboard-accessible visibility, ordering, pinning, auto-fit, and width-reset menu.
exportfalse | DataTableExportOptionsClient export is enabled by default; false hides it, while options constrain formats and set a filename base.
onCellCommit(request: DataTableCellCommitRequest<Row>, signal: AbortSignal) => Promise<CellCommitResult<ColumnValue, string>>Required by editable columns; receives row/column context, a per-cell commit ID, previous/value snapshot, and AbortSignal, then reports acceptance or an explicit conflict.
editResetKeystring | numberDiscards drafts, conflicts, failed attempts, and pending commits when an account or permission boundary changes.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.