DataTable

A sortable, searchable table component with column definitions and flexible rendering.

Live Demo

NameRoleStatus
Alice JohnsonEngineerActive
Bob SmithDesignerInactive
Charlie BrownManagerActive

Props

PropTypeDefaultDescription
columnsDataTableColumn[]Column definitions: key, header, sortable, render.
dataT[]Array of row data objects.
searchablebooleanfalseShow a search input above the table.
searchPlaceholderstring'Search…'Placeholder text for the search input.
emptyMessagestring'No results.'Message shown when no rows match the filter.

Usage

import { DataTable } from '@ghiberti85/ui'

const columns = [
  { key: 'name', header: 'Name', sortable: true },
  { key: 'role', header: 'Role' },
  { key: 'status', header: 'Status', render: (val) => <span>{String(val)}</span> },
]

const data = [
  { name: 'Alice', role: 'Engineer', status: 'Active' },
  { name: 'Bob', role: 'Designer', status: 'Inactive' },
]

<DataTable columns={columns} data={data} searchable />

View in Storybook

Open in Storybook
Ghiberti UI — Design System