Props
| Name | Type | Default | Description |
|---|---|---|---|
accessibleLabel | ((columns: MappedCell[], item: any) => string) | undefined | - | Function that accepts the columns and the current item as
arguments and returns a label to be used for accessibility purposes.
The cells arrive in RENDER order (they follow Called with the mapped cells in render order, so look a cell up by |
actionsText | string | undefined | - | Label used in the header of the actions column. |
align | "left" | "center" | "right" | undefined | "left" | Text alignment of the columns. |
caption | string | undefined | - | Caption that describes the content of the table. Used for accessibility purposes. The table's accessible name, and the fallback name of the |
columns | BbTableColumn<T>[] | undefined | [] | Array of definitions of how the columns should be rendered. Write these as |
compact | boolean | undefined | false | Adds a CSS class that applies a compact style to the component. |
dependencies | unknown[] | undefined | [] | Defines an array of dependencies that will trigger actions in the component upon change. |
depsDebounceTime | number | undefined | 0 | Timeout used to debounce response to changes to dependencies. |
disabled | boolean | undefined | false | Disables the component |
disableSelectAll | boolean | undefined | false | Hides the "Select all" checkbox that selectable multi-row tables display by default. Replaces v2's |
displayCaption | boolean | undefined | false | Boolean that defines whether to display or hide the caption. By default is true and the caption is hidden. |
enforceCoherence | boolean | undefined | false | After every load (initial, Leave it off on any table whose page turn goes through |
expandedItems | any[] | undefined | [] | Used by |
fixed | boolean | undefined | false | Splits the width equally among the columns that declare no |
fixedActions | boolean | undefined | false | Pins the actions column (the one the |
fixedHeaders | boolean | undefined | false | Boolean that sets the headers as sticky to the top of the table. |
fixedSelect | boolean | undefined | false | Pins the selection column to the left edge, Pinned cells are opaque and paint the table's |
headerRowClass | Classes | undefined | - | Defines the classes to be passed to the header row. |
highlighted | any | - | Used by |
id | string | undefined | - | 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 | string | boolean | undefined | - | Opt a nested table into inheriting its column widths from an ancestor
table's matching tracks (accounting for |
interactiveWhileLoading | boolean | undefined | false | Keeps the table interactive while it is loading. The header and the rows are
|
itemsrequired | Item[] | ((prefill: boolean, modelValue?: any) => Item[] | Promise<Item[]>) | [] | Rows to render, or a fetcher that returns them. Pass rows or a provider. Put filters and sort in |
itemValue | ItemAccessor<Item> | undefined | - | Stable row identity as a path or function. Set it before adding selection, expansion or highlight so those models survive refetches. See example |
keyboardNavigation | boolean | undefined | false | Opt-in keyboard navigation with a roving tabindex: the body is one tab
stop, ArrowUp/ArrowDown move the focused row (Home/End jump), and
Enter/Space activate it through the same path as a mouse click (highlight
toggle + Screen readers in browse mode intercept the arrow keys, so a reader takes the usual focus-mode step before the roving tabindex responds. Pair it with a bound |
legend | string | undefined | - | Text content of the Only rendered by a |
loading | boolean | undefined | false | Sets the component in a loading state, usually triggering some visual styles. With no rows yet this renders skeletons; over existing rows the rows stay on screen (dimmed, with an indeterminate bar) rather than being replaced — a refetch should not blank 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 | string | undefined | the localized `common.loadingText` ("Loading...") | Screen-reader announcement for the loading row's |
max | number | undefined | Infinity | Maximum number of items that can be selected. |
modelValue | any | [] | Used by v-model. Can be any serializable type. |
multiple | boolean | undefined | true | Allows the selection of multiple items. |
name | string | undefined | - | Defines the name of the input. |
noDataText | string | undefined | the localized `common.noDataText` ("No data to display") | String displayed when there are no items to display. Also the place to explain a failed fetch: there is no |
order | string[] | undefined | [] | Used by |
page | string | number | undefined | - | Current page number starting from 1, used for accessibility purposes.
Also flows into the shared table context, so a |
perPage | string | number | undefined | - | Number of items per page, used for accessibility purposes. Also flows
into the shared table context read by a |
pt | PtItemMap<BbTablePtPart, "row", BbTablePtState, Item> | undefined | - | Passthrough, object form: the same keys as the |
pt:body | PtValue | undefined | - | |
pt:body:highlighted | PtValue | undefined | - | |
pt:body:loading | PtValue | undefined | - | |
pt:body:selected | PtValue | undefined | - | |
pt:cell | PtValue | undefined | - | |
pt:cell:highlighted | PtValue | undefined | - | |
pt:cell:loading | PtValue | undefined | - | |
pt:cell:selected | PtValue | undefined | - | |
pt:head | PtValue | undefined | - | |
pt:head:highlighted | PtValue | undefined | - | |
pt:head:loading | PtValue | undefined | - | |
pt:head:selected | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:highlighted | PtValue | undefined | - | |
pt:root:loading | PtValue | undefined | - | |
pt:root:selected | PtValue | undefined | - | |
pt:row | PtValue | ((ctx: PtItemCtx<Item, BbTablePtState>) => PtItemResult) | undefined | - | |
pt:row:highlighted | PtValue | undefined | - | |
pt:row:loading | PtValue | undefined | - | |
pt:row:selected | PtValue | undefined | - | |
pt:table | PtValue | undefined | - | |
pt:table:highlighted | PtValue | undefined | - | |
pt:table:loading | PtValue | undefined | - | |
pt:table:selected | PtValue | undefined | - | |
readonly | boolean | undefined | false | Sets the input in a readonly state. |
reorderable | boolean | undefined | false | Lets the user reorder the data columns: drag a header cell (AG Grid style —
the column moves live under the pointer and a chip with its label follows)
or, from the keyboard, use each header's reorder handle (ArrowLeft /
ArrowRight move the column one slot, Home / End to the ends). Every move
writes |
resizable | boolean | undefined | false | Lets the user resize the data columns of a root table: drag the handle on
a header's trailing edge (the column follows live, the width commits on
release), or press Alt + ArrowLeft / ArrowRight on the focused header;
double-click the handle to go back to the declared width. Each commit
fires |
rowClass | BbTableRowClasses<Item> | undefined | - | Defines the classes to be passed to each data row. Can also be a function of the row's item for dynamic values. The column-level |
selectable | boolean | ((item: Item) => boolean) | undefined | - | Defines whether the table is selectable. Can be a global boolean that affects all rows or a function that accepts an item and returns a boolean that only affects that item. |
selectAll | boolean | undefined | false | Defines whether the "Select all" checkbox is checked. |
selectAllLabel | string | undefined | - | Text of the label used by the "Select all" boolean. Select-all is the "everything across every page" affordance: while it is on, |
selectText | string | undefined | - | Text of the header used for the radio inputs when the table is not |
sort | BbTableSortEntry[] | undefined | [] | Used by |
tdClass | ColumnClasses<Item> | undefined | - | Defines the classes to be passed to every data cell. Can also be a function for dynamic values. |
thClass | Classes | undefined | - | Defines the classes to be passed to every header cell. |
totalItems | string | number | undefined | - | Total number of items there is. Also flows into the shared table
context, where a Pass it with |
totalPages | string | number | undefined | - | Seeds the page count shown by a |
unselectedItems | any[] | undefined | [] | Items that are not selected. |
virtual | boolean | undefined | false | Windows the body: only the rows in (and just around) the vertical
scrollport are mounted, so a client-side dataset of any size scrolls at
a constant cost. The table itself is the scroller as soon as you bound
its height ( 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 | Type | Description |
|---|---|---|
expandedItems | any[] | undefined | Holds the open rows by |
highlighted | any | Bind |
modelValue | any | Holds row values resolved through |
order | string[] | undefined | Bind it without |
selectAll | boolean | undefined | |
sort | BbTableSortEntry[] | undefined | 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 | any[] | undefined |
Events
| Name | Type | Description |
|---|---|---|
click:row | (e: "click:row", event: MouseEvent, item: any): void | The payload is |
contextmenu:row | (e: "contextmenu:row", event: MouseEvent, item: any): void | |
dblclick:row | (e: "dblclick:row", event: MouseEvent, item: any): void | |
hide:column | (e: "hide:column", key: string): void | A column was hidden from its header (a |
item:selected | (e: "item:selected", value: any): void | |
item:unselected | (e: "item:unselected", value: any): void | |
resize:column | (e: "resize:column", key: string, width: number | null): void | A column was resized by the user ( Fires once per committed resize, with |
update:expandedItems | (e: "update:expandedItems", value: any[]): void | |
update:highlighted | (e: "update:highlighted", value: any): void | |
update:modelValue | (e: "update:modelValue", value: any): void | |
update:order | (e: "update:order", value: string[]): void | |
update:selectAll | (e: "update:selectAll", value: boolean): void | |
update:sort | (e: "update:sort", value: BbTableSortEntry[]): void | |
update:unselectedItems | (e: "update:unselectedItems", value: any[]): void |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
<key> | object | One column's body cell in every row, by the column The name is the column |
actions | { 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 rendered in the actions cell for each row. Providing this slot
is what CREATES the actions column (there is no prop): the header cell
(labelled by |
expand | { 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:<key> | 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 |
header:<key>:append | BbTableHeaderAffixSlotProps<Item> | Content after one column's header, keeping the sort button; beats |
header:<key>:prepend | BbTableHeaderAffixSlotProps<Item> | Content before one column's header, keeping the sort button; beats |
header:actions | { text: string; } | Replaces the default actions header cell content. |
header:append | BbTableHeaderAffixSlotProps<Item> | Content rendered after every data column's header cell content — the
label + sort control, or the column's own Renders after the column's existing header content, so the built-in sort button survives — which a full |
header:prepend | BbTableHeaderAffixSlotProps<Item> | Content rendered before every data column's header cell content — the
label + sort control, or the column's own The mirror of |
header:select | { multiple: boolean; selectAll: boolean; text: string; } | Replaces the default selection header cell content (checkbox or radio label). |
loading | { 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 |
no-data | object | Content shown when the items list is empty and not loading. It fills the table's own full-width empty-state cell (it already spans the selection/actions columns), so provide the *content* — a message, an illustration, a "clear filters" button — never a row/cell of your own. 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 |
select | { 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 |
tbody | object | Replaces the content of the body row group ( Role-complete |
tfoot | { columnCount: number; } | Fills the footer row group ( The markup you pass is grid markup: |
thead | object | Replaces the content of the header row group ( Role-complete rows of |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
actionsremovedfails silentlyallowSelectAlldisableSelectAllfails silentlyenabledWhileLoadinginteractiveWhileLoadingfails silentlyfixedColumnsremovedfails silently