Sidenav

Ready

The sidenav component is part of the layout of the application and it makes easier to divide the main screen into two different areas. The main area will have all the content and the sidenav as a secondary element as an index, including links to different resources on the web page.

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

Props

NameDefaultDescription
children: nodeThe area inside the sidenav. The content will be placed inside a stack with a divider between each element.
title: nodeThe area assigned to render the title. It is highly recommended to use the sidenav title.

DxcSidenav.Title

The title should be only used in the sidenav title prop.

Props

NameDefaultDescription
children: nodeThe area inside the sidenav title. This area can be used to render custom content.

DxcSidenav.Section

This must be defined as children of the Sidenav. It helps to separate groups and links into different agroupations. It has the following props:

Props

NameDefaultDescription
children: nodeThe area inside the sidenav section. This area can be used to render sidenav groups, links and custom content.

DxcSidenav.Group

Even though any children are accepted in the group we recommend using only the DxcSidenav.Link or any react based router with the DxcSidenav.Link.

Props
NameDefaultDescription
children: nodeThe area inside the sidenav group. This area can be used to render sidenav links.
title: stringThe title of the sidenav group.
collapsable: booleanfalseIf true the sidenav group title will be considered a button and the group will be collapsable.
icon: SVG | stringThe icon to be displayed next to the title of the group.

As the DxcLink component, we decided to make our link component in the sidenav just a styled HTML anchor element which allows it to be used in any React based router. You can check the Link for more information regarding this.

NameDefaultDescription
tabIndex: number0Value of the tabindex.
href: stringPage to be opened when the user clicks on the link.
newWindow: booleanfalseIf true, the page is opened in a new browser tab.
icon: SVG | stringElement or path used as the icon that will be placed to the left of the link text.
selected: booleanfalseIf true, the link will be marked as selected.
children: stringThe area inside the sidenav link.
onClick: functionThis function will be called when the user clicks the link and the event will be passed to this function.

Examples

Application layout with sidenav