Search docs

Search blocks and features…

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-table

Usage

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

PropTypeDefaultDescription
enableSorting?booleantruePer-column option on every col.* method. When false, the header renders without a sort toggle.