Skip to content
PixiKit

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
NameTypeDefaultDescription
menusSwitchMenu[]DEFAULT_MENUSThe menus in the row, in order.
valuestring | nullNoneThe id of the open menu, or `null` for none, when you hold the state.
onValueChange(id: string | null) => voidNoneCalled 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.
openDelaynumber80Milliseconds the pointer rests on a trigger before the panel opens.
closeDelaynumber140Milliseconds 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) => voidNoneCalled with the link the user picks and its click event; call preventDefault to handle navigation yourself.
currentstringNoneThe id of the link to show as current.
ariaLabelstring"Main"Name for the navigation, read by screen readers.
breakpointnumber640Width in px under which the row becomes a button that opens an accordion.
classNamestringNone

Related