Sorting
Click a column header to cycle ascending / descending / none — no configuration required.
Installation
Sorting ships with Data Table — no separate install.
Works with:Data Table
npx shadcn@latest add @kotsas-ui/data-tableUsage
Every field built with defineColumns is sortable by default. Click a header to cycle ascending / descending / none.
Set up CI pipeline | High | Done | $2,400.00 | True |
Design onboarding flow | Medium | In progress | $3,200.00 | False |
Migrate auth to OAuth2 | Urgent | In progress | $5,600.00 | False |
Write API docs | Low | To do | $900.00 | False |
Examples
Opt a column out when its order carries no meaning (internal ids, action columns):
// Opt a column out — its header renders as plain text, no sort button.
col.text("id", { enableSorting: false })API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| enableSorting? | boolean | true | Per-column option on every col.* method. When false, the header renders without a sort toggle. |