DataTable Sort Menu
niko-table/data-table-sort-menuFreeComponent
Sort management menu with multi-column sorting and drag-and-drop reordering.
Install it
npx shadcn@latest add https://niko-table.com/r/data-table-sort-menu.jsonSource
1"use client"23/**4 * niko-table — created by Semir N. (Semkoo, https://github.com/Semkoo) with AI assistance.5 *6 * Before reporting anything: please check the changelog first.7 * - In-repo: ./CHANGELOG.md8 * - Docs site: https://niko-table.com/changelog9 *10 * Found a bug or have a fix? Open an issue or PR on GitHub so other11 * users (and future LLMs reading this code) benefit:12 * https://github.com/Semkoo/niko-table-registry13 */14import { useDataTable } from "../core/data-table-context"15import {16 TableSortMenu,17 type TableSortMenuProps,18} from "../filters/table-sort-menu"1920type DataTableSortMenuProps<TData> = Omit<TableSortMenuProps<TData>, "table">2122/**23 * A sort menu component that automatically connects to the DataTable context24 * and allows users to manage multiple sorting criteria.25 *26 * @example - Basic usage with default settings27 * <DataTableSortMenu />28 *29 * @example - Custom alignment and positioning30 * <DataTableSortMenu align="end" side="bottom" />31 *32 * @example - With debounce for performance33 * <DataTableSortMenu debounceMs={300} />34 *35 * @example - With throttle for frequent updates36 * <DataTableSortMenu throttleMs={100} />37 *38 * @example - Custom styling39 * <DataTableSortMenu className="w-[400px]" />40 */41export function DataTableSortMenu<TData>(props: DataTableSortMenuProps<TData>) {42 const { table } = useDataTable<TData>()43 return <TableSortMenu<TData> table={table} {...props} />44}4546/**47 * @required displayName is required for auto feature detection48 * @see "feature-detection.ts"49 */5051DataTableSortMenu.displayName = "DataTableSortMenu"
What it pulls in
npm packages
Other registry items
Files it writes
More from niko-table
All 31 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| DataTable Asidedata-table-aside | niko-table | Components | Free | 1 dep | |
| DataTable Clear Filterdata-table-clear-filter | niko-table | Components | Free | 1 dep · 2 files | |
| DataTable Column Auto-fitdata-table-column-auto-fit | niko-table | Components | Free | no deps · 2 files | |
| DataTable Column Date Filterdata-table-column-date-filter | niko-table | Components | Free | 2 deps · 2 files | |
| DataTable Column DnDdata-table-column-dnd | niko-table | Components | Free | 4 deps · 3 files | |
| DataTable Column Faceted Filterdata-table-column-faceted-filter | niko-table | Components | Free | 1 dep · 3 files | |
| DataTable Column Hidedata-table-column-hide | niko-table | Components | Free | 1 dep · 2 files | |
| DataTable Column Pindata-table-column-pin | niko-table | Components | Free | 1 dep · 2 files |
