Display menu
How a view shows: its layouts, grouping, ordering, switches, properties. Built from props, or composed from parts.
import { DisplayMenu, DisplayLayouts, DisplaySelect, DisplayToggle, DisplayProperties, DisplaySection, DisplayWhen, DisplayReset, MORE_LAYOUTS, type DisplayOptions } from "@forgeron/ui";{
"layout": "board",
"grouping": "assignee",
"ordering": "due",
"toggles": {
"emptyGroups": true
},
"properties": [
"id",
"due"
]
}timeline · zoom weeks · milestones onAPI → Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | DisplayOptions | — | { layout, grouping, ordering, toggles: Record<id, boolean>, properties: id[], options?: Record<name, string> }. |
onChange | (value: DisplayOptions) => void | — | Called on every change; changes apply at once. |
children | ReactNode | — | The parts, in any order: DisplayLayouts, DisplaySelect (grouping, ordering, or any name kept in options), DisplayToggle, DisplayProperties, DisplaySection, DisplayWhen layout=…, DisplayReset. Without children the props below build the usual menu. |
open / onOpenChange | boolean / (open) => void | — | Opens the menu from outside, e.g. from the V shortcut (useDisclosure). |
groupings | SelectMenuOption[] | — | The ways to group rows: Status, Assignee, No grouping. |
orderings | SelectMenuOption[] | — | The ways to order rows: Priority, Due date, Updated. |
toggles | { id, label }[] | [] | Switches such as Show sub-issues, Show empty groups. |
properties | { id, label }[] | [] | The properties a row can show, toggled as chips. |
layouts | { value, label, icon?, kbd? }[] | List, Board | The layout switch; [] hides it. |
defaultValue | DisplayOptions | — | Offers Reset to default when the value differs from it. |
label | string | "Display" | The words of the button. |
className | string | — | Extra classes. |