Props
| Name | Description |
|---|---|
accessibleLabel Type: ((columns: MappedCell[], item: any) => string) | The label of each row's selection checkbox, from Called with the mapped cells in render order, so look a cell up by |
actionsText Type: string | Label used in the header of the actions column. |
align Type: "left" | "center" | "right"Default"left" | Text alignment of the columns. |
caption Type: string | Caption describing the table's content, for accessibility. The table's accessible name, and the fallback name of the |
columns Type: BbTableColumn<T>[]Default[] | Array of definitions of how the columns should be rendered. Write these as |
compact Type: booleanDefaultfalse | Adds a CSS class that applies a compact style to the component. |
dependencies Type: unknown[]Default[] | Defines an array of dependencies that will trigger actions in the component upon change. |
depsDebounceTime Type: numberDefault0 | Timeout used to debounce response to changes to dependencies. |
disabled Type: booleanDefaultfalse | Disables the component |
disableSelectAll Type: booleanDefaultfalse | Hides the "Select all" checkbox that selectable multi-row tables display by default. Replaces v2's |
displayCaption Type: booleanDefaultfalse | Shows the caption as a visible title. Off by default: the caption is hidden, and screen readers still hear it as the table's name. |
emptyText Type: stringDefaultthe localized common.emptyText ("No data to display") | Text shown when there are no items. Also the place to explain a failed fetch: there is no |
enforceCoherence Type: booleanDefaultfalse | After every load, prunes Leave it off on any provider-paginated table ( |
expandedItems Type: any[]Default[] | Used by |
failedText Type: stringDefaultthe localized common.failedText ("Couldn't load items") | String displayed in the empty state while the latest load FAILED (the |
fixed Type: booleanDefaultfalse | Gives the columns that declare no |
fixedActions Type: booleanDefaultfalse | Pins the actions column (the one the |
fixedFirst Type: booleanDefaultfalse | Sticks the |
fixedHeaders Type: booleanDefaultfalse | Sticks the headers to the top of the table. |
fixedLast Type: booleanDefaultfalse | Sticks the |
fixedSelect Type: booleanDefaultfalse | Pins the selection column to the left edge, Pinned cells are opaque and paint the table's |
headerRowClass Type: Classes | Classes for the header row. |
highlightable Type: boolean | ((item: Item) => boolean) | Which rows a click, Enter or |
highlighted Type: any | Used by |
id Type: string | Stable id for this table's width context. When omitted a unique id is generated. Nested tables use the nearest ancestor id to inherit widths. The rendezvous key for |
inheritColumnWidths Type: string | boolean | Snaps a nested table's columns to an ancestor table's tracks: |
interactiveWhileLoading Type: booleanDefaultfalse | Keeps the header and rows interactive while loading (by default they are |
items requiredType: Item[] | ((context: BbTableItemsContext) => Item[] | Promise<Item[]>)Default[] | Rows to render: an array, or a provider called with a Pass rows or a provider. Put filters and sort in |
itemValue Type: ItemAccessor<Item> | The row's value, as a property path or a function returning any value; the selection, Stable row identity as a path or function. Set it before adding selection, expansion or highlight so those models survive refetches. See example |
keyboardNavigation Type: booleanDefaultfalse | Opt-in keyboard navigation: the table becomes an ARIA Makes the table an ARIA grid (a treegrid with |
legend Type: string | The Only rendered by a |
loading Type: booleanDefaultfalse | Loading state: skeletons with no rows yet, else the rows stay on screen, dimmed, under an indeterminate bar. A refetch never blanks a table the user is reading. With rows already on screen this no longer blanks the table: the rows stay, dimmed, under a progress bar, and the header and rows go |
loadingText Type: stringDefaultthe localized common.loadingText ("Loading...") | Screen-reader announcement for the loading row's |
max Type: numberDefaultInfinity | Maximum number of items that can be selected. |
modelValue Type: anyDefault[] | Used by v-model. Can be any serializable type. |
multiple Type: booleanDefaulttrue | Allows the selection of multiple items. |
multiSort Type: booleanDefaultfalse | A plain click on a sortable header adds the column to the sort, as Shift+click always does. Off, a plain click makes the sort that column alone. |
name Type: string | Defines the name of the input. |
order Type: string[]Default[] | Used by |
page Type: string | number | Current page (from 1), for the rows' |
perPage Type: string | number | Rows per page, for |
pt Type: PtItemMap<BbTablePtPart, "row" | "expand", BbTablePtState, Item> | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | ((ctx: PtItemCtx<Item, BbTablePtState>) => PtItemResult) | Passthrough, attribute form: one attribute per part, |
readonly Type: booleanDefaultfalse | Sets the input in a readonly state. |
reorderable Type: booleanDefaultfalse | Lets the user reorder the data columns: drag a header, or Shift+←/→ on a focused header. Every move writes |
reorderableRows Type: booleanDefaultfalse | Adds a drag handle at the start of each row: the user drags a row, or lifts it with Space / Enter and the arrow keys, and |
resizable Type: booleanDefaultfalse | Lets the user resize the data columns (drag a header's trailing edge, or Alt+←/→; double-click resets). Each commit fires |
rowClass Type: BbTableRowClasses<Item> | Classes for each data row, or a function of the row's item. The column-level |
selectable Type: boolean | ((item: Item) => boolean) | Makes rows selectable: a boolean for every row, or a function of the row's item deciding for that row. |
selectAll Type: booleanDefaultfalse | Whether the "Select all" checkbox is checked. |
selectAllLabel Type: string | Label of the "Select all" checkbox. Select-all is the "everything across every page" affordance: while it is on, |
selectText Type: string | Header text of the radio column when the table is not |
sort Type: BbTableSortEntry[]Default[] | Used by |
tdClass Type: ColumnClasses<Item> | Classes for every data cell, or a function of |
thClass Type: Classes | Classes for every header cell. |
totalItems Type: string | number | Total row count, for Pass it with |
totalPages Type: string | number | Seeds a paired |
unselectedItems Type: any[]Default[] | Items that are not selected. |
virtual Type: booleanDefaultfalse | Windows the body: only the rows near the scrollport are mounted. Bound the table's height to make it the scroller; column widths are measured once, from the first rows. Ignored when inheriting widths and under a Bound the height of the table or of an ancestor, or the page becomes the scroller. Columns are measured once from the first batch and then hold, and their cells clip with an ellipsis instead of wrapping — a column that must wrap needs a declared |
v-model
Values kept in sync through v-model.
| Name | Description |
|---|---|
expandedItems Type: any[] | Holds the open rows by |
highlighted Type: any | Bind |
modelValue Type: any | Holds row values resolved through |
order Type: string[] | Bind it without |
selectAll Type: boolean | |
sort Type: BbTableSortEntry[] | The array order is the sort priority. The table reports it and never applies it: sort your own array, or forward it to the server as |
unselectedItems Type: any[] |
Events
| Name | Description |
|---|---|
click:row Type: (event: MouseEvent, item: any): void | A body row was clicked, or activated with Enter/Space under The payload is |
contextmenu:row Type: (event: MouseEvent, item: any): void | A body row was right-clicked. Carries the DOM |
dblclick:row Type: (event: MouseEvent, item: any): void | A body row was double-clicked. Carries the DOM |
hide:column Type: (key: string): void | A column was hidden through a header slot's |
item:selected Type: (value: any): void | The user selected one row. Carries the row's value (read through |
item:unselected Type: (value: any): void | The user unselected one row. Carries the row's value, like |
reorder:rows Type: (payload: { item: any; from: number; to: number; }): void | A row was moved ( |
resize:column Type: (key: string, width: number | null): void | The user resized a column ( Fires once per committed resize, with |
update:expandedItems Type: (value: any[]): void | Emitted with the new value whenever |
update:highlighted Type: (value: any): void | Emitted with the new value whenever |
update:modelValue Type: (value: any): void | Emitted with the new value whenever |
update:order Type: (value: string[]): void | Emitted with the new value whenever |
update:selectAll Type: (value: boolean): void | Emitted with the new value whenever |
update:sort Type: (value: BbTableSortEntry[]): void | Emitted with the new value whenever |
update:unselectedItems Type: (value: any[]): void | Emitted with the new value whenever |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
<key> Type: object | One column's body cell in every row, by the column The name is the column |
<key>:first Type: BbTableEdgeCellSlotProps<Item> | One column's cell in a row before the data rows; any such slot creates the row, aligned with the columns. Only over rows. |
<key>:header Type: object | One column's header content, replacing its label and the built-in sort button. Scope: Replaces the header and the built-in sort button with it. To add beside the label and keep sorting, use |
<key>:header:append Type: BbTableHeaderAffixSlotProps<Item> | Content after one column's header, keeping the sort button; beats |
<key>:header:prepend Type: BbTableHeaderAffixSlotProps<Item> | Content before one column's header, keeping the sort button; beats |
<key>:last Type: BbTableEdgeCellSlotProps<Item> | One column's cell in a row after the data rows (a totals row); any such slot creates that row, aligned like |
actions Type: { expanded?: boolean | undefined; expandProps?: ExpandControllerProps | undefined; toggleExpanded?: (() => void) | undefined; highlighted?: boolean | undefined; toggleHighlighted?: (() => void) | undefined; selected?: boolean | undefined; toggleSelected?: (() => void) | undefined; item: Item; value: any; } | Content of each row's actions cell; this slot CREATES the actions column (there is no prop). The header cell (labelled by |
actions:header Type: { text: string; } | Replaces the default actions header cell content. |
empty Type: { error: unknown; } | Content shown when there are no rows and nothing is loading, inside the table's own full-width cell: pass content, never a row. Fills the table's own full-width cell, already centred and already spanning every column. Pass content, not a row — v2 handed this slot the whole |
expand Type: { expanded: boolean; expandProps?: ExpandControllerProps | undefined; toggleExpanded: () => void; highlighted?: boolean | undefined; toggleHighlighted?: (() => void) | undefined; selected?: boolean | undefined; toggleSelected?: (() => void) | undefined; item: Item; value: any; } | Full-width expandable content row rendered below each main row when expanded. One full-width row below its record. |
header:append Type: BbTableHeaderAffixSlotProps<Item> | Content after every data column's header content (the label + sort control, or its own Renders after the column's existing header content, so the built-in sort button survives — which a full |
header:prepend Type: BbTableHeaderAffixSlotProps<Item> | Content before every data column's header content (the label + sort control, or its own The mirror of |
loading Type: { items: Item[]; } | Content shown while table rows are loading (replaces the skeleton rows). Replaces the skeleton, so it follows the skeleton's rule: first load only. A refetch over existing rows keeps them and shows the built-in progress bar instead, which this slot cannot change. See example |
select Type: { item: Item; value: any; checked: boolean; disabled: boolean; inputName: string; readonly: boolean; toggleSelected?: (() => void) | undefined; } | Replaces the default checkbox/radio in the selection cell for each row. Replaces a row's checkbox or radio while keeping the table's selection path. This is the supported way to change the control — rebuilding selection with your own checkbox in a cell slot is not. See example |
select:header Type: { multiple: boolean; selectAll: boolean; text: string; } | Replaces the default selection header cell content (checkbox or radio label). |
tbody Type: object | Replaces the content of the body row group ( Role-complete |
tfoot Type: { columnCount: number; } | Fills the footer row group ( The markup you pass is grid markup: |
thead Type: object | Replaces the header row group's content ( Role-complete rows of |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
actionsremovedfails silentlyallowSelectAlldisableSelectAllfails silentlyenabledWhileLoadinginteractiveWhileLoadingfails silentlyfixedColumnsremovedfails silently- slot
header:<x><x>:headerfails silently - slot
header:<x>:append<x>:header:appendfails silently - slot
header:<x>:prepend<x>:header:prependfails silently - slot
header:actionsactions:headerfails silently - slot
header:selectselect:headerfails silently - slot
no-dataemptyfails silently noDataTextemptyTextfails silently