Skip to Content
API ReferenceTable API

Table API

Props for @/components/ui data table components. Source types live in components/ui/data-table/types.ts.

Table

PropTypeDescription
dataT[]Rows
childrencolumn elementsDeclarative columns
onSelectionChange(rows: T[]) => voidSelection callback

Generic: Table<T>.

Built-in: sorting, search (if any column is searchable), pagination (default 10), column visibility menu.

BaseColumnProps

PropType
accessorstring
headerstring
sortableboolean
searchableboolean
filterableboolean
hideableboolean

TableTextColumn

Extends BaseColumnProps:

PropType
filterOptions{ label: string; value: string }[]
transform(value: unknown) => string
numericboolean
format(value: number) => string

TableImageColumn

className?: string
alt?: (row: unknown) => string

TableSelectColumn

No required props. Enables checkbox selection.

TableAction

PropType
iconLucideIcon
labelstring
onClick(row: unknown) => void
variant"default" | "destructive"
separatorboolean

Wrap actions in TableActionsColumn.

Imports

import { Table, TableTextColumn, TableImageColumn, TableSelectColumn, TableActionsColumn, TableAction, } from '@/components/ui'

Next Steps

Last updated on