Tree view
Navigate nested folders and structured content.
Compare structured records with sortable columns.
npx shadcn@latest add @silicon-ui/sortable-data-tablenpx shadcn@latest add @silicon-ui/sortable-data-tableInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/sortable-data-table/sortable-data-table.tsxcomponents/silicon-ui/sortable-data-table/sortable-data-table.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
rows* | T[] | — |
columns* | DataColumn<T>[] | — |
rowKey* | keyof T | ((row: T) => string) | — |
caption | string | "Data table" |
emptyMessage | string | "No rows to show" |
defaultSortSort applied on the first render. | SortState | — |
onSortChange | (sort: SortState) => void | — |
selectableAdds a checkbox column, row click selection, and a count line with a clear action. | boolean | false |
selectedKeys | string[] | — |
defaultSelectedKeys | string[] | — |
onSelectionChange | (keys: string[]) => void | — |
itemNameNoun for the count line, as in "6 projects". | { one: string; other: string } | { one: "row", other: "rows" } |