Join our Discord Community
Tables

👋 This is a community-driven shadcn/ui resource. For the official documentation, visit ui.shadcn.com

Table with Sortable Columns

Sortable data table with column headers showing sort indicators and ascending/descending order toggle functionality

Looking to implement shadcn/ui blocks?

Join our Discord community for help from other developers.


Need sortable columns in your data tables? This React table implements click-to-sort on column headers with visual indicators showing sort direction. Built with shadcn/ui Table and Lucide React icons, it displays ascending/descending arrows next to sorted columns and maintains data state with useState. The table includes user data with name, email, role, and status fields—perfect for admin panels, user directories, or any dataset where sorting by different attributes helps users find information quickly.

Loading preview...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/table-sortable-01.json
npx shadcn@latest add https://www.shadcn.io/registry/table-sortable-01.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/table-sortable-01.json
bunx shadcn@latest add https://www.shadcn.io/registry/table-sortable-01.json

Questions you might have