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.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
allowMultipleExpanded | boolean | true | No | When `false`, expanding one row collapses the others. |
ariaLabel | string | — | No | Accessible name for the table, applied through `tableRootProps`. |
ariaLabelledby | string | — | No | Id of a visible label for the table, applied through `tableRootProps`. |
columnFilters | DataTableColumnFilter[] | — | No | Declared prop `columnFilters`. |
columns | readonly DataTableColumnDef<TData>[] | — | Yes | Consumer-owned column definitions. Not mutated. |
data | readonly TData[] | — | Yes | Consumer-owned rows, read by reference only (never cloned or mutated). |
defaultColumnFilters | DataTableColumnFilter[] | — | No | Declared prop `defaultColumnFilters`. |
defaultExpandedRowIds | DataTableRowId[] | — | No | Declared prop `defaultExpandedRowIds`. |
defaultGlobalFilter | unknown | — | No | Declared prop `defaultGlobalFilter`. |
defaultPagination | DataTablePaginationState | — | No | Initial uncontrolled pagination. `pageIndex` is 1-based. |
defaultSelectedRowIds | DataTableRowId[] | — | No | Declared prop `defaultSelectedRowIds`. |
defaultSelection | DataTableSelection | — | No | Initial uncontrolled selection. |
defaultSorting | DataTableColumnSort[] | — | No | Declared prop `defaultSorting`. |
disabled | boolean | false | No | Makes sort, selection, and expansion inert and disables their controls. |
enableMultiSort | boolean | false | No | Opts into multi-column sorting. |
enablePagination | boolean | true | No | When `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`. |
enableQuerySelection | boolean | false | No | Opts 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. |
enableRowExpansion | boolean | false | No | Turns on detail rows. |
enableRowSelection | boolean | false | No | Turns on selection. |
expandedRowIds | DataTableRowId[] | — | No | Declared prop `expandedRowIds`. |
getRowId | DataTableGetRowId<TData> | — | Yes | Required in every build; there is no index fallback. |
globalFilter | unknown | — | No | Declared prop `globalFilter`. |
isMultiSortEvent | ((event: KeyboardEvent | MouseEvent) => boolean) | — | No | Whether 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()`. |
loading | boolean | false | No | Sets `aria-busy="true"` through `tableRootProps`. |
manualFiltering | boolean | false | No | The server filters; filter changes reset to page 1. |
manualPagination | boolean | false | No | When `true`, `data` is one server page and `rowCount` is required. |
manualSorting | boolean | false | No | The server sorts; the root does not reorder `data`. |
maxMultiSortColCount | number | — | No | Optional cap on sorted columns with `enableMultiSort` (normalized to an integer of at least 1). |
pageCount | number | — | No | Optional page-count override. |
pagination | DataTablePaginationState | — | No | Controlled pagination. `pageIndex` is 1-based, like `GhostPagination`: the first page is `1`. |
rowCount | number | — | No | Total rows matching the query on the server. Required with `manualPagination`. |
rowCountExact | boolean | true | No | Set to `false` when `rowCount` is a server estimate: query selection counts use estimate wording and a `pageCount` override is ignored. Read only with `enableQuerySelection`. |
selectedRowIds | DataTableRowId[] | — | No | Declared prop `selectedRowIds`. |
selection | DataTableSelection | — | No | Controlled selection (`v-model:selection`). Read only with `enableQuerySelection`. |
sorting | DataTableColumnSort[] | — | No | Declared prop `sorting`. |
Emits
| Name | Payload | Description |
|---|---|---|
stateChange | DataTableStateChangePayload | Emitted as `stateChange`. |
Models
| Prop | Event | Type | Description |
|---|---|---|---|
columnFilters | update:columnFilters | DataTableColumnFilter[] | v-model binding for `columnFilters`. |
expandedRowIds | update:expandedRowIds | DataTableRowId[] | v-model binding for `expandedRowIds`. |
globalFilter | update:globalFilter | unknown | v-model binding for `globalFilter`. |
pagination | update:pagination | DataTablePaginationState | v-model binding for `pagination`. |
selectedRowIds | update:selectedRowIds | DataTableRowId[] | v-model binding for `selectedRowIds`. |
selection | update:selection | DataTableSelection | v-model binding for `selection`. |
sorting | update:sorting | DataTableColumnSort[] | v-model binding for `sorting`. |
Slots
| Name | Description |
|---|---|
default | Primary content. |
Slot props: default
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
canSelectAllMatching | boolean | Exposed property `canSelectAllMatching`. |
clearSorting | () => void | Exposed 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`. |
headerSelectionState | import('./ghost-data-table').DataTableHeaderSelectionState | Exposed property `headerSelectionState`. |
isRowSelected | (rowId: import('./ghost-data-table').DataTableRowId) => boolean | Exposed method `isRowSelected`. |
resetRowSelection | () => void | Exposed method `resetRowSelection`. |
retry | () => void | Re-emits `stateChange` with the current query and a fresh `requestId`. |
selectAllMatching | (options?: import('./ghost-data-table').DataTableSelectAllMatchingOptions) => void | Extends a fully selected page to every server row matching the filters. |
selectedCount | number | Exposed property `selectedCount`. |
selectedCountKind | import('./ghost-data-table').DataTableSelectionCountKind | Exposed property `selectedCountKind`. |
selection | import('./ghost-data-table').DataTableSelection | Effective selection. |
selectionAnnouncement | string | Exposed property `selectionAnnouncement`. |
setColumnFilter | (columnId: string, value: unknown) => void | Exposed method `setColumnFilter`. |
setColumnFilters | (columnFilters: import('./ghost-data-table').DataTableColumnFilter[]) => void | Exposed method `setColumnFilters`. |
setGlobalFilter | (globalFilter: unknown) => void | Exposed method `setGlobalFilter`. |
setPageIndex | (pageIndex: number) => void | Exposed method `setPageIndex`. |
setPageSize | (pageSize: number) => void | Exposed method `setPageSize`. |
setPagination | (pagination: import('./ghost-data-table').DataTablePaginationState) => void | Exposed method `setPagination`. |
setSorting | (sorting: DataTableColumnSort[]) => void | Exposed method `setSorting`. |
toggleAllRowsSelected | (value?: boolean) => void | Exposed method `toggleAllRowsSelected`. |
toggleRowExpanded | (rowId: import('./ghost-data-table').DataTableRowId, value?: boolean) => void | Exposed method `toggleRowExpanded`. |
toggleRowSelected | (rowId: import('./ghost-data-table').DataTableRowId, value?: boolean) => void | Exposed method `toggleRowSelected`. |
toggleSorting | (columnId: string, multi?: boolean) => void | Exposed 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
| Key | Action | Automated browser test |
|---|---|---|
Tab | Moves between the focusable controls the consumer renders (sort buttons, checkboxes, expand buttons) in DOM order. No grid or roving cell focus. | Not reviewed |
Space | Toggles a focused selection GhostCheckbox, or activates a focused sort or expand button. | Not reviewed |
Enter | Activates a focused sort or expand button. Does not toggle checkboxes. | Not reviewed |
Shift+Enter | With 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+Space | Same as Shift+Enter. The default renderers keep the Shift state from keydown when Shift is released before Space. | Not reviewed |
Escape | No 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.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
data-table/basic-invoices
GhostDataTableTable renders headers, sort buttons, and rows from typed columns, with a custom currency cell and GhostPagination.
data-table/full-invoices
Manual GhostTable composition with sort buttons, row selection, expandable detail rows, a global search, and an empty state.
data-table/paginated-invoices
Manual GhostTable composition with a co-located GhostPagination bound to the root's pagination, pageCount, and setPageIndex slot bindings; searching clamps the page.
data-table/preset-invoices
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.
data-table/server-invoices-router
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().