DXC Logo
Halstack Design System
v16.1.0

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.-
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[]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; items: (Item | GroupItem)[]; }

and Section an object with the following properties:

{ items: (Item | GroupItem)[]; title?: string }; }
-
New
onExpandedChange
(value: boolean) => voidFunction called when the expansion state of the sidenav changes.-
New
topContent
React.ReactNodeThe content rendered in the upper part of the sidenav, under the branding.-

Examples

Application layout with sidenav