Skip to content

GhostDataTable reference ​

Package: @ghostvue/vue. Status: experimental (stability policy).

Renderless DataTable root over useGhostDataTable. Renders no element; its default slot supplies tableRootProps, headers, rows, and header, row, sort, selection, and expansion bindings for composing a native GhostTable.

Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.

All component references

Props ​

NameTypeDefaultRequiredDescription
allowMultipleExpandedbooleantrueNoWhen `false`, expanding one row collapses the others.
ariaLabelstring—NoAccessible name for the table, applied through `tableRootProps`.
ariaLabelledbystring—NoId of a visible label for the table, applied through `tableRootProps`.
columnFiltersDataTableColumnFilter[]—NoDeclared prop `columnFilters`.
columnsreadonly DataTableColumnDef<TData>[]—YesConsumer-owned column definitions. Not mutated.
datareadonly TData[]—YesConsumer-owned rows, read by reference only (never cloned or mutated).
defaultColumnFiltersDataTableColumnFilter[]—NoDeclared prop `defaultColumnFilters`.
defaultExpandedRowIdsDataTableRowId[]—NoDeclared prop `defaultExpandedRowIds`.
defaultGlobalFilterunknown—NoDeclared prop `defaultGlobalFilter`.
defaultPaginationDataTablePaginationState—NoInitial uncontrolled pagination. `pageIndex` is 1-based.
defaultSelectedRowIdsDataTableRowId[]—NoDeclared prop `defaultSelectedRowIds`.
defaultSelectionDataTableSelection—NoInitial uncontrolled selection.
defaultSortingDataTableColumnSort[]—NoDeclared prop `defaultSorting`.
disabledbooleanfalseNoMakes sort, selection, and expansion inert and disables their controls.
enableMultiSortbooleanfalseNoOpts into multi-column sorting.
enablePaginationbooleantrueNoWhen `false`, a local table renders every filtered and sorted row as one page and ignores the `pagination` v-model (do not render a pager). Ignored with `manualPagination`.
enableQuerySelectionbooleanfalseNoOpts a server-paged, server-filtered table (`manualPagination` and `manualFiltering`) into query-wide selection: the `selection` v-model and `selectAllMatching()`. While `true`, `selection` is the source of truth, `selectedRowIds` is a read-only projection that is `[]` in `query` mode, and a bound `selectedRowIds` is ignored with a warning.
enableRowExpansionbooleanfalseNoTurns on detail rows.
enableRowSelectionbooleanfalseNoTurns on selection.
expandedRowIdsDataTableRowId[]—NoDeclared prop `expandedRowIds`.
getRowIdDataTableGetRowId<TData>—YesRequired in every build; there is no index fallback.
globalFilterunknown—NoDeclared prop `globalFilter`.
isMultiSortEvent((event: KeyboardEvent | MouseEvent) => boolean)—NoWhether a sort button activation adds to the sort instead of replacing it. Ignored unless `enableMultiSort` is `true`. Pass `() => true` for modifier-free multi-sort, paired with a visible control that calls `clearSorting()`.
loadingbooleanfalseNoSets `aria-busy="true"` through `tableRootProps`.
manualFilteringbooleanfalseNoThe server filters; filter changes reset to page 1.
manualPaginationbooleanfalseNoWhen `true`, `data` is one server page and `rowCount` is required.
manualSortingbooleanfalseNoThe server sorts; the root does not reorder `data`.
maxMultiSortColCountnumber—NoOptional cap on sorted columns with `enableMultiSort` (normalized to an integer of at least 1).
pageCountnumber—NoOptional page-count override.
paginationDataTablePaginationState—NoControlled pagination. `pageIndex` is 1-based, like `GhostPagination`: the first page is `1`.
rowCountnumber—NoTotal rows matching the query on the server. Required with `manualPagination`.
rowCountExactbooleantrueNoSet to `false` when `rowCount` is a server estimate: query selection counts use estimate wording and a `pageCount` override is ignored. Read only with `enableQuerySelection`.
selectedRowIdsDataTableRowId[]—NoDeclared prop `selectedRowIds`.
selectionDataTableSelection—NoControlled selection (`v-model:selection`). Read only with `enableQuerySelection`.
sortingDataTableColumnSort[]—NoDeclared prop `sorting`.

Emits ​

NamePayloadDescription
stateChangeDataTableStateChangePayloadEmitted as `stateChange`.

Models ​

PropEventTypeDescription
columnFiltersupdate:columnFiltersDataTableColumnFilter[]v-model binding for `columnFilters`.
expandedRowIdsupdate:expandedRowIdsDataTableRowId[]v-model binding for `expandedRowIds`.
globalFilterupdate:globalFilterunknownv-model binding for `globalFilter`.
paginationupdate:paginationDataTablePaginationStatev-model binding for `pagination`.
selectedRowIdsupdate:selectedRowIdsDataTableRowId[]v-model binding for `selectedRowIds`.
selectionupdate:selectionDataTableSelectionv-model binding for `selection`.
sortingupdate:sortingDataTableColumnSort[]v-model binding for `sorting`.

Slots ​

NameDescription
defaultPrimary content.

Slot props: default ​

None declared.

Exposed members ​

NameTypeDescription
canSelectAllMatchingbooleanExposed property `canSelectAllMatching`.
clearSorting() => voidExposed method `clearSorting`.
getPrePaginationRowModel() => readonly import('./ghost-data-table').DataTableRow<TData>[]Exposed method `getPrePaginationRowModel`.
getRowModel() => readonly import('./ghost-data-table').DataTableRow<TData>[]Exposed method `getRowModel`.
getSelectedRowModel() => readonly import('./ghost-data-table').DataTableRow<TData>[]Exposed method `getSelectedRowModel`.
headerSelectionStateimport('./ghost-data-table').DataTableHeaderSelectionStateExposed property `headerSelectionState`.
isRowSelected(rowId: import('./ghost-data-table').DataTableRowId) => booleanExposed method `isRowSelected`.
resetRowSelection() => voidExposed method `resetRowSelection`.
retry() => voidRe-emits `stateChange` with the current query and a fresh `requestId`.
selectAllMatching(options?: import('./ghost-data-table').DataTableSelectAllMatchingOptions) => voidExtends a fully selected page to every server row matching the filters.
selectedCountnumberExposed property `selectedCount`.
selectedCountKindimport('./ghost-data-table').DataTableSelectionCountKindExposed property `selectedCountKind`.
selectionimport('./ghost-data-table').DataTableSelectionEffective selection.
selectionAnnouncementstringExposed property `selectionAnnouncement`.
setColumnFilter(columnId: string, value: unknown) => voidExposed method `setColumnFilter`.
setColumnFilters(columnFilters: import('./ghost-data-table').DataTableColumnFilter[]) => voidExposed method `setColumnFilters`.
setGlobalFilter(globalFilter: unknown) => voidExposed method `setGlobalFilter`.
setPageIndex(pageIndex: number) => voidExposed method `setPageIndex`.
setPageSize(pageSize: number) => voidExposed method `setPageSize`.
setPagination(pagination: import('./ghost-data-table').DataTablePaginationState) => voidExposed method `setPagination`.
setSorting(sorting: DataTableColumnSort[]) => voidExposed method `setSorting`.
toggleAllRowsSelected(value?: boolean) => voidExposed method `toggleAllRowsSelected`.
toggleRowExpanded(rowId: import('./ghost-data-table').DataTableRowId, value?: boolean) => voidExposed method `toggleRowExpanded`.
toggleRowSelected(rowId: import('./ghost-data-table').DataTableRowId, value?: boolean) => voidExposed method `toggleRowSelected`.
toggleSorting(columnId: string, multi?: boolean) => voidExposed method `toggleSorting`.

Parts and data attributes ​

None declared.

CSS variables ​

None declared.

Accessibility ​

Role: table. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/table/.

Required ARIA attributes: none.

Keyboard ​

KeyActionAutomated browser test
TabMoves between the focusable controls the consumer renders (sort buttons, checkboxes, expand buttons) in DOM order. No grid or roving cell focus.Not reviewed
SpaceToggles a focused selection GhostCheckbox, or activates a focused sort or expand button.Not reviewed
EnterActivates a focused sort or expand button. Does not toggle checkboxes.Not reviewed
Shift+EnterWith enableMultiSort, adds the focused sort button's column to the sort, flips it from ascending to descending in place, or removes it. Otherwise the same as Enter.Not reviewed
Shift+SpaceSame as Shift+Enter. The default renderers keep the Shift state from keydown when Shift is released before Space.Not reviewed
EscapeNo sort effect. It never clears the sort.Not reviewed

Verification ​

Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.

CategoryStatusEvidence
Automated keyboardNot reviewedNo declared key is mapped to a browser test yet.
Manual interactionNot reviewedNo review recorded.
Assistive technologyNot reviewedNo review recorded.

Examples ​

data-table/basic-invoices ​

Example source

Basic table Headless

GhostDataTableTable renders headers, sort buttons, and rows from typed columns, with a custom currency cell and GhostPagination.

ACME Corp1200.00 USD
Globex980.50 USD

data-table/full-invoices ​

Example source

Full composition Headless

Manual GhostTable composition with sort buttons, row selection, expandable detail rows, a global search, and an empty state.

Details
ACME Corp1200.00 USD (ACME Corp)
Globex980.50 USD (Globex)
Details for inv-2
Initech42.00 USD (Initech)

data-table/paginated-invoices ​

Example source

Pagination Headless

Manual GhostTable composition with a co-located GhostPagination bound to the root's pagination, pageCount, and setPageIndex slot bindings; searching clamps the page.

InvoiceCustomerAmount
inv-01ACME Corp100.00 USD
inv-02Globex137.50 USD
inv-03Initech175.00 USD
inv-04Umbrella212.50 USD
inv-05ACME Corp250.00 USD

data-table/preset-invoices ​

Example source

Preset Headless

GhostDataTablePreset renders search, sort buttons, row selection, expandable detail rows, and an empty state from typed columns, with a custom currency cell and a co-located GhostPagination.

Details
ACME Corp1200.00 USD
Globex980.50 USD
inv-2 was billed to Globex.
Initech42.00 USD
Umbrella310.00 USD
Hooli75.25 USD

data-table/server-invoices-router ​

Example source

Server data with URL state Headless

Server sorting, filtering, and paging synced to the URL: hydrates from the query string, pushes one history entry per committed query, ignores stale responses after Back, and recovers with retry().

Status

No invoices