SortButton
A menu button that sorts a list by a chosen field.
Installation
pnpm dlx shadcn@latest add @chelone/sort-buttonA menu button that sorts a list by a chosen field.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | — | |
| fields | string[] | — | |
| icon | ReactNode | — | |
| label | string | — | |
| ref | Ref<HTMLButtonElement> | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). |
| resource | string | — | |
| size | "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | — | |
| variant | "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | — |