Skip to content

GhostDataTablePreset reference ​

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

Batteries-included default child of GhostDataTable (spec example (a′)). Renders a labelled global search field, a selection column with a select-all checkbox, an expansion column with labelled expand buttons and detail rows, sort buttons for sortable columns, and a GhostEmptyState row when nothing renders. Each column id is an optional typed cell slot like GhostDataTableTable; #detail, #toolbar, and #search add or replace content. Use it instead of a manual #default composition, not next to one.

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

All component references

Props ​

NameTypeDefaultRequiredDescription
columnsTColumns—NoColumns to render, in order, matched to the parent `GhostDataTable` columns by `id` (ids the parent does not have are skipped). Defaults to every parent column. Pass the same array you give `GhostDataTable` to type the `#<columnId>` slots.
containHorizontalboolean—NoWhen true, wraps the table in a scroll container for explicit horizontal overflow. The table itself never receives implicit overflow.
emptyHeadingLevelGhostEmptyStateHeadingLevel3NoHeading level of the empty-state title. Match the page outline (axe `heading-order`): one below the nearest heading above the table.
emptyTitlestring"No results"NoVisible title of the `GhostEmptyState` shown when no rows render.
expansionHeaderLabelstring"Details"NoAccessible name of the expansion column header (visually hidden text in the `<th>`).
layoutSlotsreadonly TLayout[]—NoOpt into the named layout slots on this preset: `toolbarStart`, `toolbarEnd`, `bulkActions`, `footer`, `emptyDescription`, and `emptyActions`. Omit to keep every layout slot name available for cells.
rowExpansionLabel((rowId: DataTableRowId) => string)"`Show details for ${String(rowId)}`"NoAccessible name of a row's expand button.
rowSelectionLabel((rowId: DataTableRowId) => string)"`Select row ${String(rowId)}`"NoAccessible name of a row's selection checkbox.
scrollLabelstring—NoAccessible name for the horizontal scroll region. When omitted and a {@link GhostTableCaption } is rendered, the scroll region uses `aria-labelledby` on the caption id.
searchLabelstring"Search"NoVisible label of the default search field.
selectAllLabelstring"Select all rows"NoAccessible name of the select-all checkbox.
selectionAnnouncementLabel((context: DataTableSelectionAnnouncementContext) => string)"defaultSelectionAnnouncementLabel"NoLocalized polite announcement after a selection action, while the parent has `enableQuerySelection` (rendered outside the table). The default reads "25 rows selected. All 2,300 matching rows can be selected.", "All 2,300 matching rows selected.", "Selection cleared.", or "Selection cleared because the filter changed."
selectionHeaderLabelstring"Selection"NoAccessible name of the selection column header (`aria-label` on the `<th>`, which holds only the select-all checkbox).
showGlobalFilterboolean—NoShows the search field (or `#search` slot). Defaults to `true` when any column takes part in the global filter (an accessor and `enableColumnFilter !== false`).
sortAnnouncementLabel((entries: readonly DataTableSortAnnouncementEntry[]) => string)"defaultSortAnnouncementLabel"NoLocalized polite announcement after a user changes the sort, while the parent has `enableMultiSort`. Receives the new sort in priority order.
sortDescriptionLabel((context: DataTableSortDescriptionContext) => string)"defaultSortDescriptionLabel"NoLocalized rank description for each sort button while more than one column is sorted (`aria-describedby`, rendered outside the table).

Emits ​

None declared.

Models ​

None declared.

Slots ​

NameDescription
detailContent of an expanded row's detail `<tr>` (one cell spanning the row).
searchReplaces the default search field (for example to debounce input).
toolbarRendered before the search field and the table.

Slot props: detail ​

None declared.

NameTypeDescription
disabledboolean`true` while the parent `GhostDataTable` is disabled.
labelstringThe preset's `searchLabel`.
setValue(value: string) => voidCommits a global filter through the root (resets the page on server filtering).
valuestringCurrent global filter as text (`''` when cleared).

Slot props: toolbar ​

None declared.

Exposed members ​

None declared.

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 search field, the select-all checkbox, sort buttons, row checkboxes, and expand buttons in DOM order. No grid or roving cell focus.Not reviewed
SpaceToggles a focused selection checkbox, or activates a focused sort or expand button.Not reviewed
EnterActivates a focused sort or expand button. Does not toggle checkboxes.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 ​

None declared.