SidebarMenu.Root Events#
| Type | Description | |
|---|---|---|
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#
| Type | Description | |
|---|---|---|
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#
| Type | Description | |
|---|---|---|
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#
| Type | Description | |
|---|---|---|
onClick | (event: React.MouseEvent<HTMLElement>) => void | (optional) Called when the item is activated after the Root selection state is updated. |
SidebarMenu.Accordion Events#
| Type | Description | |
|---|---|---|
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. |