Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Table

Async Table

Table.vue
0 loadedLoading…
Name
Email
Role
Status
MRR

Install

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/table-async

Import the shared styles once in your application.

TSUsage
import TableAsync from '@/components/beui/tables/Table.vue'
import '@/components/beui/styles.css'

API Reference

data
readonly Row[]
Default—
columns
readonly TableColumn<Row>[]
Default—
getRowId?
(row: Row, index: number) => string

Stable id per row, required for correct selection across sorts. Defaults to row index.

Default—
selectable?
boolean

Render a leading checkbox column with select-all in the header.

Default—
v-model:selectedRowIds?
readonly string[]
Default—
defaultSelectedRowIds?
readonly string[]
Default—
@selection-change?
(ids: string[]) => void
Default—
v-model:sort?
SortState | null
Default—
defaultSort?
SortState | null
Default—
resizable?
boolean

Allow dragging the right edge of a header to resize that column.

Default—
minColumnWidth?
number

Minimum column width in px when resizing.

Default—
@column-resize?
(key: string, width: number) => void
Default—
reorderable?
boolean

Allow dragging a header grip to reorder columns.

Default—
@column-order-change?
(keys: string[]) => void
Default—
onCellEdit?
(rowId: string, columnKey: string, value: string) => void

Called when an `editable` cell changes.

Default—
onColumnRename?
(key: string, value: string) => void

When set, non-sortable headers become editable inputs for the column name.

Default—
onInsertRow?
(index: number, position: InsertPosition) => void

Enables the row menu (Insert before / after). Receives the target index.

Default—
onDeleteRow?
(rowId: string, index: number) => void

Enables Delete in the row menu.

Default—
onInsertColumn?
(index: number, position: InsertPosition) => void

Enables the column menu (Insert before / after). Receives the target column index.

Default—
onDeleteColumn?
(key: string, index: number) => void

Enables Delete in the column menu.

Default—
rowHeight?
number

Fixed row height in px — required for virtualization.

Default—
height?
number

Scroll viewport height in px.

Default—
overscan?
number

Rows rendered above/below the viewport.

Default—
@end-reached?
() => void

Fires when the viewport scrolls near the bottom — load the next page.

Default—
loading?
boolean

Currently fetching — shows skeleton rows and pauses `onEndReached`.

Default—
skeletonRows?
number

How many skeleton rows to show while loading more (default 3).

Default—
emptyState?
VNodeChild
Default—
labels?
Partial<TableMessages>

Override any built-in string. `{row}` and `{column}` fill the per-row and per-column labels.

Default—
class?
string
Default—
label?
string
Default—
@sort-change?
(sort: SortState | null) => void
Default—

Updated