Skip to content
PixiKit

Tree Nav

A sidebar tree of any depth. Branches open by height, one highlight slides to the current item across levels, and an icon rail shows labels in a flyout.

pixikit.com/docs/app-ui/navigation/tree-nav

Customize

Accordion
Auto reveal
Collapsed
Density

Props

14
NameTypeDefaultDescription
itemsTreeNavItem[]NoneThe items of the tree, nested.
groupsTreeNavGroup[]NoneLabelled sections, used instead of `items`.
valuestringNoneThe id of the current item, when you hold the state.
defaultValuestringNoneThe current item at first, when the tree holds the state.
onValueChange(id: string) => voidNoneCalled with the id of the item the user activates.
expandedstring[]NoneThe ids of the open parents, when you hold the state.
defaultExpandedstring[]NoneThe open parents at first, when the tree holds the state.
onExpandedChange(ids: string[]) => voidNoneCalled with the ids of the open parents after a change.
accordionbooleanfalseOpening a parent closes its siblings.
autoRevealbooleantrueOpens the parents of the current item on mount and when it changes.
collapsedbooleanfalseIcon-only rail: labels hide and show in a small flyout on hover and focus.
density"comfortable" | "compact""comfortable"The height of a row.
ariaLabelstring"Navigation"Name for the tree, read by screen readers.
classNamestringNone

Related