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.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
columns | TColumns | — | No | Columns 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. |
containHorizontal | boolean | — | No | When true, wraps the table in a scroll container for explicit horizontal overflow. The table itself never receives implicit overflow. |
emptyHeadingLevel | GhostEmptyStateHeadingLevel | 3 | No | Heading level of the empty-state title. Match the page outline (axe `heading-order`): one below the nearest heading above the table. |
emptyTitle | string | "No results" | No | Visible title of the `GhostEmptyState` shown when no rows render. |
expansionHeaderLabel | string | "Details" | No | Accessible name of the expansion column header (visually hidden text in the `<th>`). |
layoutSlots | readonly TLayout[] | — | No | Opt 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)}`" | No | Accessible name of a row's expand button. |
rowSelectionLabel | ((rowId: DataTableRowId) => string) | "`Select row ${String(rowId)}`" | No | Accessible name of a row's selection checkbox. |
scrollLabel | string | — | No | Accessible name for the horizontal scroll region. When omitted and a {@link GhostTableCaption } is rendered, the scroll region uses `aria-labelledby` on the caption id. |
searchLabel | string | "Search" | No | Visible label of the default search field. |
selectAllLabel | string | "Select all rows" | No | Accessible name of the select-all checkbox. |
selectionAnnouncementLabel | ((context: DataTableSelectionAnnouncementContext) => string) | "defaultSelectionAnnouncementLabel" | No | Localized 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." |
selectionHeaderLabel | string | "Selection" | No | Accessible name of the selection column header (`aria-label` on the `<th>`, which holds only the select-all checkbox). |
showGlobalFilter | boolean | — | No | Shows 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" | No | Localized 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" | No | Localized 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
| Name | Description |
|---|---|
detail | Content of an expanded row's detail `<tr>` (one cell spanning the row). |
search | Replaces the default search field (for example to debounce input). |
toolbar | Rendered before the search field and the table. |
Slot props: detail
None declared.
Slot props: search
| Name | Type | Description |
|---|---|---|
disabled | boolean | `true` while the parent `GhostDataTable` is disabled. |
label | string | The preset's `searchLabel`. |
setValue | (value: string) => void | Commits a global filter through the root (resets the page on server filtering). |
value | string | Current 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
| Key | Action | Automated browser test |
|---|---|---|
Tab | Moves 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 |
Space | Toggles a focused selection checkbox, or activates a focused sort or expand button. | Not reviewed |
Enter | Activates 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.
| 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
None declared.