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
appTitleReact.ReactNodeObject used to configure the header application title.-
bottomContentReact.ReactNodeThe content rendered in the bottom part of the sidenav, under the navigation menu.-
defaultExpandedbooleanInitial state of the expansion of the sidenav, only when it is uncontrolled.-
displayGroupLinesbooleanIf true the nav menu will have lines marking the groups.false
expandedbooleanIf 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[]Array of items to be displayed in the navigation menu. Each item can be a single/simple item, a group item or a section.

Being Item an object with the following properties:

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

The renderItem property allows wrapping the item with custom routing components (e.g., Next.js Link) that require children to be passed.

, 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 }; }
-
onExpandedChange(value: boolean) => voidFunction called when the expansion state of the sidenav changes.-
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.-
topContentReact.ReactNodeThe content rendered in the upper part of the sidenav, under the branding.-

Examples

Application layout with sidenav