Expand commentComment on line R9Resolved

Sidenav

The sidenav component provides a vertical navigation structure placed on the left side of the interface. It provides global access to navigation, branding, and user actions, ensuring consistency and orientation across products and applications.

It is part of the application layout, so it can only be used inside of it. Please check the DxcApplicationLayout documentation.

Props

NameTypeDescriptionDefault
New
appTitle
React.ReactNodeObject used to configure the header application title.-
New
bottomContent
React.ReactNodeThe content rendered in the bottom part of the sidenav, under the navigation menu.-
New
defaultExpanded
booleanInitial state of the expansion of the sidenav, only when it is uncontrolled.-
New
displayGroupLines
booleanIf true the nav menu will have lines marking the groups.false
New
expanded
booleanIf true, the sidenav is expanded. If undefined the component will be uncontrolled and the value will be managed internally by the component.-
New
navItems
(Item | GroupItem)[] | Section[]

being Item an object with the following properties:

{ badge?: ReactElement; icon?: string | SVG; label: string; onSelect?: () => void; selected?: boolean; }

, GroupItem an object with the following properties:

{ badge?: ReactElement; icon?: string | SVG; label: string; defaultOpen?: boolean; items: (Item | GroupItem)[]; }

and Section an object with the following properties:

{ items: (Item | GroupItem)[]; title?: string }; }
Array of items to be displayed in the navigation menu. Each item can be a single/simple item, a group item or a section.-
New
onExpandedChange
(value: boolean) => voidFunction called when the expansion state of the sidenav changes.-
New
searchBar
{ onBlur: (value: string) => void; onChange: (value: string) => void; onEnter: (value: string) => void; placeholder?: string; }
When provided, a search bar will be rendered at the top of the sidenav.-
New
topContent
React.ReactNodeThe content rendered in the upper part of the sidenav, under the branding.-

Examples

Application layout with sidenav