Skip to main content

Sidebar Menu

Renders a list of nested and collapsible menus

Storybook Docs

Props

NameTypeDefaultDescription
collapseButtonPropsOmit<ICollapseButtonProps, 'opened>-Props, or function returning props for the Controlled CollapseButton component, with the exception of the opened prop
defaultOpenedIds(number | string)[]Default opened menus, using id field of IMenuItem
defaultSelectedIdnumber | stringDefault selected menu id, referencing the id field of IMenuItem in menu
hasOnlyOneOpenMenubooleanfalseKeeps only one menu per level open at once
menu *IMenuItem[]-The IMenuItem list to be rendered
menuOpenValue(number | string)[]Controlled state of which menus are currently open, using id field of IMenuItem in menu
onMenuOpen(id: number | string, isOpened: boolean, path: (number | string)[]) => voidCallback fired when menu is opened or closed, id and path use the ids fields of IMenuItem in menu
...--extends Paper props

IMenuItem

AttributeTypeDescription
childrenIMenuItem[]Nested array of menus
contentReactNodeContent shown inside the menu
id *number | stringMenu id
label *number | stringMenu label
leftIconReactNodeMenu icon