Switch Panel
An app or workspace switcher: a row of triggers that opens one shared panel of grouped links. The panel resizes to its content, the content slides in the direction of travel, and a highlight and an arrow follow the active trigger.
pixikit.com/docs/app-ui/navigation/switch-panel
Customize
Trigger
Open delay80ms
Close delay140ms
Align
Breakpoint640px
Props
12| Name | Type | Default | Description |
|---|---|---|---|
menus | SwitchMenu[] | DEFAULT_MENUS | The menus in the row, in order. |
value | string | null | None | The id of the open menu, or `null` for none, when you hold the state. |
onValueChange | (id: string | null) => void | None | Called with the id of the menu that opens, or `null` when the panel closes. |
trigger | "hover" | "click" | "hover" | `hover` opens a menu when the pointer rests on its trigger; `click` only on a click. |
openDelay | number | 80 | Milliseconds the pointer rests on a trigger before the panel opens. |
closeDelay | number | 140 | Milliseconds the panel waits after the pointer leaves before it closes. |
align | "start" | "center" | "full" | "start" | `start` and `center` size the panel to its content under the row; `full` spans the whole component. |
onSelect | (link: SwitchLink, event: MouseEvent) => void | None | Called with the link the user picks and its click event; call preventDefault to handle navigation yourself. |
current | string | None | The id of the link to show as current. |
ariaLabel | string | "Main" | Name for the navigation, read by screen readers. |
breakpoint | number | 640 | Width in px under which the row becomes a button that opens an accordion. |
className | string | None |