Skip to main content
Version: Next

DataTable API

import { DataTable } from '@editora/ui-react';

Props​

PropTypeDescription
borderedboolean
bulkActionsLabelstring
bulkClearLabelstring
childrenReact.ReactNode
columnOrderstring
compactboolean
draggableColumnsboolean
elevation'default' | 'none' | 'low' | 'high'
emptyTextstring
filterColumnstring | number
filterQuerystring
filterRulesDataTableFilterRule[]
headlessboolean
hiddenColumnsArray<string | number>Columns to hide, by key (data-key or header text) or 0-based index.
hideSummaryboolean
hoverboolean
layout'fixed' | 'auto'auto: columns take the width their content needs instead of an equal share (the default, fixed). Ignored with resizable columns or virtualized rows, which need fixed widths.
loadingboolean
multiSelectboolean
onBulkClear(detail: DataTableBulkClearDetail) => void
onColumnOrderChange(detail: DataTableColumnOrderChangeDetail) => void
onColumnResize(detail: DataTableColumnResizeDetail) => void
onFilterChange(detail: DataTableFilterChangeDetail) => void
onNavigate(detail: DataTableRowNavigateDetail) => voidRuns before a row link (<tr data-href>) is followed. Call detail.preventDefault() to route it yourself; a surrounding NavigationProvider does this for every component at once.
onPageChange(detail: DataTablePageChangeDetail) => void
onRowSelect(detail: DataTableRowSelectDetail) => void
onSortChange(detail: DataTableSortChangeDetail) => void
onVirtualRangeChange(detail: DataTableVirtualRangeChangeDetail) => void
overscannumber
pagenumber
pageSizenumber
paginationIdstring
pinColumnsstring | { left?: Array<string | number>; right?: Array<string | number> }
resizableColumnsboolean
rowHeightnumber
selectableboolean
serverSidebooleanThe rows passed in are the current page, already sorted and filtered by the server: the table shows them as they are and still reports sort, filter and page changes for you to fetch the next set. Use with totalRows.
shape'default' | 'square' | 'soft'
sortableboolean
stateDataTableState
stateTextstring
stickyFooterboolean
stickyHeaderboolean
stripedboolean
totalRowsnumberWith serverSide: the number of rows in the whole result, for the summary and paging.
variant'default' | 'flat' | 'contrast'
virtualizeboolean

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).

Element: <ui-data-table>​

DataTable renders the ui-data-table custom element from @editora/ui-core, which can also be used without React.

Attributes: bordered, bulk-actions-label, bulk-clear-label, column-order, compact, draggable-columns, elevation, empty-text, filter-column, filter-query, filters, headless, hidden-columns, hide-summary, hover, loading, multi-select, overscan, page, page-size, pagination-id, pin-columns, resizable-columns, row-height, selectable, server-side, shape, sortable, state, state-text, sticky-footer, sticky-header, striped, total-rows, variant, virtualize

Events: bulk-clear, column-order-change, column-resize, filter-change, page-change, row-select, sort-change, virtual-range-change