Skip to Content
DocumentationSwitcher

Switcher

A component that allows the user to switch between different teams or accounts.

Example

API

Switcher

PropertyTypePossible valuesDefaultDescription
childrenReact.ReactNode--The content of the switcher (trigger and content components).
valuestring--Optional controlled value for the selected item.
onValueChange(value: string) => void--Optional callback function called when the selected value changes.
openbooleantrue, false-Controls the open state of the dropdown (controlled).
defaultOpenbooleantrue, falsefalseWhether the dropdown is initially open (uncontrolled).
onOpenChange(open: boolean) => void--Callback called when the open state changes.

SwitcherTrigger

PropertyTypePossible valuesDefaultDescription
childrenReact.ReactNode--The trigger element that opens the switcher dropdown when clicked.
asChildbooleantrue, falsetrueWhen true, merges with the immediate child element instead of rendering a button.

SwitcherContent

PropertyTypePossible valuesDefaultDescription
childrenReact.ReactNode--The content to display inside the dropdown (groups, items, separators, footer).
align”start” | “center” | “end""start”, “center”, “end""center”Alignment of the dropdown relative to the trigger element.
side”top” | “right” | “bottom” | “left""top”, “right”, “bottom”, “left""right”Side where the dropdown should appear relative to the trigger element.

SwitcherGroup

PropertyTypePossible valuesDefaultDescription
childrenReact.ReactNode--The items belonging to this group.
labelstring--Optional label displayed as the group header.

SwitcherItem

PropertyTypePossible valuesDefaultDescription
childrenReact.ReactNode--The content of the item (usually text label).
valuestring--Optional value for the item. When provided, item becomes selectable.
onClick() => void--Optional callback function called when the item is clicked.
iconstring | React.ReactNode--Optional icon to display. Can be an image URL (string) or React element.

SwitcherFooter

PropertyTypePossible valuesDefaultDescription
childrenReact.ReactNode--The content of the footer item (usually text label).
onClick() => void--Optional callback function called when the footer is clicked.
iconReact.ReactNode--Optional icon to display in the footer.

SwitcherSeparator

This component has no props. It renders a visual separator between groups or sections.

Last updated on