Skip to content

Table

A component for displaying data in rows and columns, supporting sorting, selection, and pagination.

Basic Usage

The most basic usage of the table.

ID
Name
Age
Email
1Alice24alice@example.com
2Bob28bob@example.com
3Charlie32charlie@example.com
4David21david@example.com
Example

Selection

Add row-selection property to enable multiple selection.

Selected Keys: []
ID
Name
Status
1AliceActive
2BobInactive
Example

Sorting

Set sortable: true in the column configuration to enable sorting.

Current Sort: None
ID
Name
Age
Score
1Alice2485
2Bob2892
3Charlie2178
4David3295
5Eve2488
Example

Advanced Usage

A comprehensive example including pagination, sorting, loading state, striped rows, borders, and custom column rendering.

ID
Name
Age
Status
Action
1User 120Active
2User 221Inactive
3User 322Active
4User 423Inactive
5User 524Active
Total 15 items
Example

API

Table Props

PropertyDescriptionTypeDefault
dataData to displayany[][]
columnsConfiguration of table columnsBrTableColumn[][]
rowKeyKey of row data, used for optimizing renderingstring | ((row: any) => string | number)'id'
stripeWhether to display striped rowsbooleanfalse
borderWhether to display vertical bordersbooleanfalse
hoverWhether to highlight row on hoverbooleantrue
loadingWhether to show loading statebooleanfalse
loadingTextText to show in loading statestring'Loading...'
emptyTextText to show when data is emptystring'No Data'
rowSelectionWhether to show selection columnbooleanfalse
maxHeightMaximum height of the tablestring | number-
stickyHeaderWhether to fix the table headerbooleanfalse
paginationPagination configuration, false to hideBrTablePagination | falsefalse

Table Events

Event NameDescriptionParameters
update:selectionTriggers when selection changes(selectedRowKeys: (string|number)[], selectedRows: any[])
update:paginationTriggers when pagination changes(pagination: BrTablePagination)
sortTriggers when sorting changes(sort: BrTableSort)
row-clickTriggers when a row is clicked(row: any, index: number, event: MouseEvent)

Table Slots

Slot NameDescriptionParameters
cell-[key]Custom rendering for a specific column{ row, column, index }

Column Configuration (BrTableColumn)

PropertyDescriptionTypeDefault
keyUnique identifier of the columnstring-
titleColumn titlestring-
widthColumn widthstring | number-
minWidthMinimum column widthstring | number-
maxWidthMaximum column widthstring | number-
alignAlignment'left' | 'center' | 'right''left'
fixedWhether column is fixed'left' | 'right' | boolean-
sortableWhether column is sortable, custom for custom sortboolean | 'custom'false
renderCustom render function(row: any, index: number) => any-