Data/Data Table

DataTable

A full-featured data table with sortable columns, search, pagination, row selection, and custom cell rendering. Client-side and server-side data modes supported.

import { DataTable } from "@animui/ui"

Live preview

Click column headers to sort.

NameAlice Johnson
Emailalice@example.com
RoleAdmin
StatusActive
NameBob Smith
Emailbob@example.com
RoleEditor
StatusInactive
NameCarol White
Emailcarol@example.com
RoleViewer
StatusActive
NameDavid Brown
Emaildavid@example.com
RoleEditor
StatusActive

Props

PropTypeDefaultDescription
columnsColumnDef[]Column definitions: key, header, sortable, cell (for custom cell rendering).
dataRecord<string, unknown>[]Array of row objects. Each object's keys map to column keys.
searchablebooleantrueAdds a search input that filters rows across all columns.
pageSizenumber10Number of rows per page. Set to 0 to disable pagination.
searchPlaceholderstring"Search…"Placeholder text in the search input.
onRowClick(row: Record<string, unknown>) => voidCalled when a row is clicked.
loadingbooleanfalseShows a loading spinner while data is being fetched.
emptyMessagestring"No results found."Message shown when data is empty or no rows match the search.
toolbarReact.ReactNodeCustom toolbar slot rendered to the right of the search input.
mobileLayout"cards" | "scroll""cards"How the table renders on mobile — card list or horizontal scroll.
rowClassName(row) => stringFunction that returns additional classes for each row.
captionstringAccessible caption for the table (screen reader only).
classNamestringAdditional classes on the table wrapper.
© 2026 Steal Shadow. MIT License.Report an issue