Column Definition
Defines how each column binds to dataset fields, formats values, and renders cells.
Use DataTableColumnDef for every column in the columns prop. Set ColumnType for typed sort and filter behavior, and attach custom views with cell_view or header_view.
- Defining the column schema for a new table
- Custom cell rendering (badges, links, formatted numbers)
- Typed sort and filter operators per column
- Create one
DataTableColumnDefper visible column withfieldmatching aFieldDefkey. - Set
ColumnTypewhen the column is not plain text. - Attach
cell_vieworheader_viewfor custom rendering. - Pass the vec to
DataTablevia thecolumnsprop.
Custom status column
Active |
Pending |
Typed numeric sort
Number columns sort numerically (2 before 10), not lexicographically.
10 |
2 |
Custom column header
Custom header_view and description tooltip on a column.
95 |