
Export Menu
Menus
Search by name, tag, category or type
Source and install need .
pnpm dlx shadcn@latest add @assembli/sort-menuThe "Sort" menu from a list or table toolbar. The trigger names the field and direction. Each field turns to its natural direction (newest first for dates, A → Z for text), picking it again flips it, and the order switch is worded for the field's type. Empty values last, reset to default, and a sortRows() helper with natural string ordering.
Other props pass through to the root element.
fields
SortField[]
Default DEFAULT_FIELDS
value
SortValue
defaultValue
SortValue
onValueChange
(value: SortValue) => void
resetValue
SortValue
What "Reset to default" returns to. Defaults to defaultValue.
align
"start" | "center" | "end"
Default "start"
Menu alignment to the trigger. Use "end" for a trigger at the right of a toolbar.
| Description | |||
|---|---|---|---|
| fields | SortField[] | DEFAULT_FIELDS | |
| value | SortValue | – | |
| defaultValue | SortValue | – | |
| onValueChange | (value: SortValue) => void | – | |
| resetValue | SortValue | – | What "Reset to default" returns to. Defaults to |
| align | "start" | "center" | "end" | "start" | Menu alignment to the trigger. Use "end" for a trigger at the right of a toolbar. |