Skip to content

SidebarMenu.Root#

TypeDescription
childrenReact.ReactNode(optional) Declarative menu content composed with SidebarMenu.Item, SidebarMenu.Accordion, SidebarMenu.Group, SidebarMenu.Section, SidebarMenu.Header, and SidebarMenu.Divider.
openItemsArray<string>(optional) Controlled array of open accordion ids. Selected ancestors are only opened automatically when this property is not provided.
defaultOpenItemsArray<string>(optional) Accordion ids that are initially open.
openItemsStorageKeystring(optional) Storage key used to persist the user's open accordion state between route navigations.
openItemsStorage"session"
"local"
(optional) Storage used with openItemsStorageKey. Session storage is recommended for navigation UI state.
scrollPositionStorageKeystring(optional) Storage key used to persist the nearest ScrollView's vertical position between route navigations.
scrollPositionStorage"session"
"local"
(optional) Storage used with scrollPositionStorageKey. Session storage is recommended for navigation UI state.
scrollSelectedItemIntoViewboolean(optional) Whether an off-screen selected item is positioned within the nearest ScrollView or browser viewport.
openOnFindboolean(optional) Keeps collapsed accordion content searchable and opens it when matched by the browser's find-in-page functionality.
activeSectionstring(optional) Controlled id of the visible section.
defaultActiveSectionstring(optional) Id of the initially visible section. Defaults to the section marked defaultActive, then the first section.
sectionLabelReact.ReactNode(optional) Screen-reader label for the section dropdown. Defaults to the localized SidebarMenu label.
selectedItemstring(optional) Controlled id of the selected item or page accordion. A selected page accordion opens when selection initializes or changes, regardless of stored open state, and can then be collapsed manually. Its ancestor accordions and section open automatically, but ancestors can remain collapsed with medium-weight labels to indicate that they contain the current page.
defaultSelectedItemstring(optional) Id of the initially selected item or page accordion.
[nav attributes]Various(optional) Standard HTML attributes are supported. Provide aria-label or aria-labelledby to name the navigation landmark.

SidebarMenu.Data#

TypeDescription
dataArray<SidebarMenuItemData>(optional) Recursive items used to render a menu from data.
sectionsArray<SidebarMenuSectionData>(optional) Top-level switchable sections and their recursive items.
openItemsArray<string>(optional) Controlled array of open accordion ids. Selected ancestors are only opened automatically when this property is not provided.
defaultOpenItemsArray<string>(optional) Accordion ids that are initially open.
openItemsStorageKeystring(optional) Storage key used to persist the user's open accordion state between route navigations.
openItemsStorage"session"
"local"
(optional) Storage used with openItemsStorageKey. Session storage is recommended for navigation UI state.
scrollPositionStorageKeystring(optional) Storage key used to persist the nearest ScrollView's vertical position between route navigations.
scrollPositionStorage"session"
"local"
(optional) Storage used with scrollPositionStorageKey. Session storage is recommended for navigation UI state.
scrollSelectedItemIntoViewboolean(optional) Whether an off-screen selected item is positioned within the nearest ScrollView or browser viewport.
openOnFindboolean(optional) Keeps collapsed accordion content searchable and opens it when matched by the browser's find-in-page functionality.
activeSectionstring(optional) Controlled id of the visible section.
defaultActiveSectionstring(optional) Id of the initially visible section. Defaults to the section marked defaultActive, then the first section.
sectionLabelReact.ReactNode(optional) Screen-reader label for the section dropdown. Defaults to the localized SidebarMenu label.
selectedItemstring(optional) Controlled id of the selected item or page accordion. A selected page accordion opens when selection initializes or changes, regardless of stored open state, and can then be collapsed manually. Its ancestor accordions and section open automatically, but ancestors can remain collapsed with medium-weight labels to indicate that they contain the current page.
defaultSelectedItemstring(optional) Id of the initially selected item or page accordion.
[nav attributes]Various(optional) Standard HTML attributes are supported. Provide aria-label or aria-labelledby to name the navigation landmark.

SidebarMenu.Item#

TypeDescription
idstring(required) Unique item id used for selection state.
textReact.ReactNode(optional) Visible item label.
childrenReact.ReactNode(optional) Alternative to text.
iconIconIcon(optional) Icon displayed before the label.
badgeBadgeProps["content"](optional) Badge content displayed on the right side.
suffixReact.ReactNode(optional) Additional content displayed on the right side before the badge.
badgePropsOmit<BadgeProps, "content" | "children">(optional) Additional properties passed to the Badge component. A nested notification variant is indicated on collapsible ancestor accordions.
hrefstring(optional) Renders the item as a link with this destination.
tostring(optional) Router destination passed to element.
elementReact.Element(optional) Custom link element, such as a router Link component.
targetstring(optional) Link target attribute.
relstring(optional) Link rel attribute.
disabledboolean(optional) Disables activation.
activeboolean(optional) Marks the item as the current page without managing Root selection state.

SidebarMenu.Accordion#

TypeDescription
idstring(required) Unique accordion id used by controlled open state and ARIA relationships.
textReact.ReactNode(optional) Visible accordion label.
iconIconIcon(optional) Icon displayed before the label.
badgeBadgeProps["content"](optional) Badge content displayed before the accordion indicator.
suffixReact.ReactNode(optional) Additional content displayed before the badge and accordion indicator.
badgePropsOmit<BadgeProps, "content" | "children">(optional) Additional properties passed to the Badge component. A nested notification variant is indicated on collapsible ancestor accordions.
hrefstring(optional) Makes the accordion trigger a page link that also controls expansion.
tostring(optional) Router destination passed to element.
elementReact.Element(optional) Custom link element, such as a router Link component.
childrenReact.ReactNode(optional) Nested items and accordions.
disabledboolean(optional) Disables the accordion trigger.
openboolean(optional) Controlled open state for this accordion.
defaultOpenboolean(optional) Initial local open state.
collapsibleboolean(optional) Whether nested items can be collapsed.

SidebarMenu.Section#

TypeDescription
idstring(required) Unique section id.
textReact.ReactNode(required) Label for the section toggle.
iconIconIcon(optional) Icon shown before the section label.
badgeBadgeProps["content"](optional) Notification badge displayed on the right side of the dropdown option.
badgePropsOmit<BadgeProps, "content" | "children">(optional) Additional properties passed to the dropdown option Badge component. The variant defaults to "notification".
triggerBadgeBadgeProps["content"](optional) Notification badge displayed on the right side of the selected dropdown trigger.
triggerBadgePropsOmit<BadgeProps, "content" | "children">(optional) Additional properties passed to the selected dropdown trigger Badge component. The variant defaults to "notification".
childrenReact.ReactNode(optional) Menu content shown while the section is active.

SidebarMenu.Group#

TypeDescription
idstring(optional) Unique id used for selection. Required for linked groups and generated for non-linked groups when omitted.
textReact.ReactNode(optional) Visible group title.
iconIconIcon(optional) Icon shown before a linked group title.
badgeBadgeProps["content"](optional) Badge content displayed on the right side of a linked group title.
suffixReact.ReactNode(optional) Additional content displayed before the badge.
badgePropsOmit<BadgeProps, "content" | "children">(optional) Additional properties passed to the Badge component.
childrenReact.ReactNode(optional) Nested menu content that is always visible.
hrefstring(optional) Makes the group title a page link without making it collapsible.
tostring(optional) Router destination passed to element.
elementReact.Element(optional) Custom link element, such as a router Link component.
disabledboolean(optional) Disables activation of the optional page link.

SidebarMenu.Header#

TypeDescription
textReact.ReactNode(optional) Header text.
childrenReact.ReactNode(optional) Alternative to text.
headingLevelnumber(optional) Semantic heading level.

SidebarMenu.Divider#

Supports standard HTMLAttributes<HTMLLIElement>.

SidebarMenu.PreHydrationScript#

Renders the blocking script that restores persisted SidebarMenu state before hydration. It supports standard ScriptHTMLAttributes<HTMLScriptElement> except children and dangerouslySetInnerHTML. Place it after the prerendered menu markup and before the application hydration script.

SidebarMenu.getPreHydrationScript#

Returns the same standalone script as a string for HTML templates assembled outside React.

SidebarMenu.ResizeHandle#

TypeDescription
targetRefReact.RefObject<HTMLElement>(required) Ref to the element being resized. The handle reads this element’s rendered width when dragging starts or an arrow key is pressed.
cssPropertystring(optional) CSS custom property that receives the new width as a pixel value, for example --sidebar-width: 336px. Use this property in the CSS that sizes the sidebar.
scopeSelectorstring(optional) Selector passed to targetRef.current.closest() to find where cssProperty is set. Use a shared layout ancestor when the sidebar and adjacent content both depend on the width. When omitted, the property is set on the referenced sidebar element.
minWidthnumber(optional) Smallest width the handle can write, in pixels. Use layout CSS for any additional responsive constraints.
maxWidthnumber(optional) Largest width the handle can write, in pixels.
collapseThresholdnumber(optional) Width in pixels at which continued pointer dragging calls onCollapse. Defaults to half of minWidth.
stepnumber(optional) Number of pixels added or removed when pressing ArrowRight or ArrowLeft.
largeStepnumber(optional) Number of pixels added or removed when pressing Shift together with ArrowRight or ArrowLeft.
[button attributes]Various(optional) Standard button attributes are supported. Set aria-controls to the id of the resized sidebar. The default accessible label is "Resize sidebar".

SidebarMenu.ResponsiveProvider#

TypeDescription
breakpointMediaQuerySizes
`${number}em`
(optional) Maximum viewport width at which the mobile navigation is used. Use an Eufemia breakpoint name or an explicit em value.
styleNoncestring(optional) CSP nonce forwarded to first-paint CSS generated for a custom breakpoint.
openboolean(optional) Controlled Drawer state.
defaultOpenboolean(optional) Initial uncontrolled Drawer state.
inlineCollapsedboolean(optional) Controlled desktop inline navigation state.
defaultInlineCollapsedboolean(optional) Initial uncontrolled desktop inline navigation state.

SidebarMenu.ResponsiveTrigger#

TypeDescription
controlsstring(optional) Id of the responsive Drawer controlled by the trigger.
inlineControlsstring(optional) Id of the desktop inline navigation restored by the trigger.
[Button properties]Various(optional) Supports Button properties except aria-expanded and aria-haspopup, which are managed by the responsive navigation.

SidebarMenu.ResponsiveDrawer#

TypeDescription
idstring(optional) Id matched by ResponsiveTrigger controls.
dialogTitleReact.ReactNode(optional) Accessible name of the Drawer.
[Drawer properties]Various(optional) Supports Drawer properties except open, which is managed by ResponsiveProvider.

SidebarMenu.useResponsive#

Returns SidebarMenuResponsiveValue with:

  • open, setOpen, toggle, and close for the small-screen Drawer.
  • isSmallScreen for the active responsive mode.
  • inlineCollapsed, collapseInline, and restoreInline for dismissible desktop navigation.
Suggest an edit