Skip to content

Data Viewer

An enterprise-level data viewing component based on BrConfigProvider for global theme configuration. It supports multiple view switching, filtering, and exporting, and can seamlessly integrate with BrTable and BrCard.

Component Features

  • 🔄 Multi-view Switching: Supports fast switching between table, card, JSON, and tree structures.
  • Data Highlighting: Easily highlight important keywords in your data.
  • 📑 Built-in Pagination: Integrated client-side pagination with search filtering support.
  • 🎨 Theme Customization: Supports global theme customization based on BrConfigProvider.

Basic Usage & Multi-view Switching

Supports fast switching between table, card, JSON, and tree structures.

ID
Full Name
Email Address
Role
Status
1Alice Smithalice@example.comAdminActive
2Bob Jonesbob@example.comUserInactive
Example

Card View & Data Highlighting

Set the default view to card via default-view="card", and combine with highlight-keywords to implement keyword highlighting.

Item 1

ID1
Full NameAlice Smith
Email Addressalice@example.com
RoleAdmin
StatusActive

Item 2

ID2
Full NameBob Jones
Email Addressbob@example.com
RoleUser
StatusInactive
Example

Theme Customization & Global Configuration

Demonstrates how to globally configure component styles via BrConfigProvider.

ID
Full Name
Email Address
Role
Status
1Alice Smithalice@example.comAdminActive
2Bob Jonesbob@example.comUserInactive
Example

Pagination

Set :pagination="true" to enable automatic client-side pagination, or pass an object for controlled pagination.

Built-in Client Pagination

Set :pagination="true" to enable automatic client-side pagination.

ID
Full Name
Email Address
Role
Status
1User 1user1@example.comAdminInactive
2User 2user2@example.comUserActive
3User 3user3@example.comEditorActive
4User 4user4@example.comAdminActive
5User 5user5@example.comEditorInactive
6User 6user6@example.comUserPending
7User 7user7@example.comAdminActive
8User 8user8@example.comUserActive
9User 9user9@example.comEditorInactive
10User 10user10@example.comAdminActive
Example

API Reference

BrDataViewer

PropTypeDefaultDescription
dataany[][]Bound data source
columnsBrDataViewerColumn[][]Column configuration
defaultView'table' | 'json' | 'tree' | 'card''table'Default view type
allowedViewsDataViewType[]['table', 'json', 'tree', 'card']List of allowed views to switch
loadingbooleanfalseWhether it is in a loading state
errorstring | Error | nullnullError message
emptyTextstring'No data'Empty data prompt
heightstring | number-Container height
paginationBrDataViewerPagination | booleanfalsePagination configuration. Set to true to use built-in client pagination, or pass a configuration object to fully control the pagination state.
highlightKeywordsstring[][]Keywords to highlight

BrDataViewerColumn

PropTypeDefaultDescription
keystring-Column key
titlestring-Column title
widthstring | number-Column width
render(row: any, index: number) => any-Custom render function
hiddenbooleanfalseWhether to hide this column

Events

Event NameParametersDescription
update:pagination(pagination: BrDataViewerPagination)Triggered when pagination changes
view-change(view: string)Triggered when view switches