Skip to content

Vue Components

TypeDoc cannot parse Vue Single File Components, so the nine .vue components in @toolbox-web/grid-vue are documented here instead of in the generated API Reference. Everything else the package exports — composables, adapters, registries, and types — is generated into that reference (see Vue → API Reference in the sidebar).

For task-oriented guidance, see Vue Integration.

Wraps <tbw-grid>, binds row data and column definitions, converts feature props into plugins, and forwards every grid event as a Vue emit.

Generic parameter: TRow = unknown — the row shape.

NameTypeDefault
rowsTRow[][]
columnsColumnShorthand<TRow>[]undefined
columnDefaultsPartial<ColumnConfig<TRow>>undefined
gridConfigGridConfig<TRow>undefined
fitModeFitModeundefined
columnInferenceColumnInferenceModeundefined
sortablebooleanundefined
filterablebooleanundefined
selectablebooleanundefined
loadingbooleanundefined
customStylesstringundefined

In addition, one feature prop per plugin is accepted. All of them are optional and default to undefined; passing one enables the matching plugin. The full set and its exact types live in AllFeatureProps:

selection, editing, clipboard, contextMenu, multiSort, filtering, reorderColumns, visibility, pinnedColumns, groupingColumns, columnVirtualization, rowDragDrop, groupingRows, pinnedRows, stickyRows, tree, masterDetail, responsive, undoRedo, export, print, pivot, serverSide, tooltip.

Each feature prop requires its side-effect import (for example import '@toolbox-web/grid-vue/features/selection'). See Vue Integration for the import list.

Every event in the core DataGridEventMap is re-emitted under its native name, with the original CustomEvent as the payload — for example @cell-click, @sort-change, @selection-change, @row-commit, @tbw-scroll, @render.

NameSlot propsPurpose
defaultnoneChild declarations: TbwGridColumn, TbwGridDetailPanel, tool panels, types.
NameType
gridElementRef<DataGridElement<TRow> | null>
forceLayout() => void
getConfig() => GridConfig<TRow> | undefined
ready() => Promise<void> | undefined
  • inheritAttrs is false; unrecognised attributes are forwarded to the inner <tbw-grid> via v-bind="$attrs".
  • When getRowId is configured and rows is replaced with a new array reference, the component diffs by value and calls updateRows() with source 'sync' so unchanged rows are not marked dirty.
  • A teleport manager mounts renderers with the parent component’s context, so provide/inject, Pinia, Vue Router, and i18n work inside cells, editors, detail panels, and tool panels.

Declares one column and, optionally, its Vue-rendered cell, editor, and header content. Must be a child of TbwGrid.

Generic parameters: TRow = unknown, TValue = any. Specify them (<TbwGridColumn<Employee, string>>) to get fully typed slot props.

NameTypeRequired
fieldstringyes
headerstringno
widthstring | numberno
minWidthstring | numberno
maxWidthstring | numberno
ordernumberno
sortablebooleanno
resizablebooleanno
editablebooleanno
typestringno
align'left' | 'center' | 'right'no
hiddenbooleanno
NameSlot props typePurpose
cellCellSlotProps<TRow, TValue>Cell renderer.
editorEditorSlotProps<TRow, TValue>Cell editor. Receives commit, cancel, updateRow, onValueChange.
headerHeaderSlotProps<TRow>Whole header cell. You own sort icons and filter buttons via renderSortIcon / renderFilterButton. Resize handles are still appended by the grid.
headerLabelHeaderLabelSlotProps<TRow>Label only. The grid keeps sort icons, filter buttons, and resize handles.

Registers a renderer and/or editor for every column whose type matches name. Place it inside TbwGrid.

Generic parameters: TRow = unknown, TValue = any.

NameTypeRequired
namestringyes
paramsRecord<string, string | number | boolean>no

params entries become kebab-cased data-* attributes on the underlying <tbw-grid-type> element (statusCode: 'pending'data-status-code="pending").

NameSlot props typePurpose
cellCellSlotProps<TRow, TValue>Type-level cell renderer.
editorEditorSlotProps<TRow, TValue>Type-level editor. Requires the editing feature.

Registers a detail-panel renderer for expandable rows. Requires the Master-Detail plugin.

NameTypeDefault
showExpandColumnbooleantrue
animation'slide' | 'fade' | false'slide'
NameSlot props typePurpose
defaultDetailPanelContext<TRow>{ row, rowIndex }.

Registers a card renderer used by the Responsive plugin when the grid switches to card layout.

NameTypeDefault
cardRowHeightnumber | 'auto''auto'
NameSlot props typePurpose
defaultResponsiveCardContext<TRow>{ row, rowIndex }.

Registers a collapsible side panel in the grid shell. Requires the Shell plugin.

NameTypeRequiredDefault
idstringyes
titlestringnoundefined
labelstringnoundefined
iconstringnoundefined
position'left' | 'right'no'right'
widthstringno'250px'

title is the canonical name and matches the React and Angular adapters. label is a Vue-only alias kept for backward compatibility; when both are set, title wins.

NameSlot props typePurpose
defaultToolPanelContext{ gridElement }.

Teleports reactive Vue content into the shell header. Must be a descendant of TbwGrid and requires the Shell plugin.

NameTypeDefault
idstringauto-generated
ordernumber100

Changing id or order after mount unregisters and re-registers the content.

NameSlot propsPurpose
defaultnoneContent placed in the header bar.

Teleports reactive Vue content into the shell toolbar. Same props and slot as TbwGridHeaderContent. Use it when the toolbar content needs Vue state, props, or callbacks; use TbwGridToolButtons for static markup.

Light-DOM passthrough that renders its children inside <tbw-grid-tool-buttons>. No props, no emits, and no context preservation — the markup is moved verbatim.

NameSlot propsPurpose
defaultnoneButton markup.
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://toolboxjs.com/llms-full.txt