Skip to content

SidebarMenu.Root Events#

TypeDescription
onOpenItemsChange(openItems: string[]) => void(optional) Called whenever an accordion opens or closes with all open accordion ids.
onActiveSectionChange(sectionId: string) => void(optional) Called when a section toggle is selected.
onSelectedItemChange(itemId: string) => void(optional) Called when a leaf item is selected.

SidebarMenu.Data supports the same events.

SidebarMenu.ResizeHandle Events#

TypeDescription
onCollapse() => void(optional) Called when pointer dragging reaches collapseThreshold. Below minWidth, the handle applies resistance to communicate that continued dragging can collapse the sidebar.

SidebarMenu.ResponsiveProvider Events#

TypeDescription
onOpenChange(open: boolean) => void(optional) Called whenever the responsive Drawer opens or closes.
onInlineCollapsedChange(collapsed: boolean) => void(optional) Called whenever the desktop inline navigation collapses or restores.

SidebarMenu.Item Events#

TypeDescription
onClick(event: React.MouseEvent<HTMLElement>) => void(optional) Called when the item is activated after the Root selection state is updated.

SidebarMenu.Accordion Events#

TypeDescription
onClick(event: React.MouseEvent<HTMLElement>) => void(optional) Called when the optional page link is activated.
onOpenChange(open: boolean) => void(optional) Called whenever this accordion opens or closes.
Suggest an edit