Skip to content

SubNav

Alpha

Use the SubNav component for navigation on a dashboard-type interface with another set of navigation components above it. This helps distinguish navigation hierarchy.

To use SubNav with react-router or react-router-dom, pass as={NavLink} and omit the selected prop. This ensures that the NavLink gets activeClassName='selected'

Attention: Make sure to properly label your SubNav with an aria-label to provide context about the type of navigation contained in SubNav.

Default example

Component props

NameTypeDefaultDescription
actionsNodePlace another element, such as a button, to the opposite side of the navigation items.
alignStringUse right to have navigation items aligned right.
fullBooleanUsed to make navigation fill the width of the container.
aria-labelStringUsed to set the aria-label on the top level <nav> element.
sxSystemStyleObject{}Style to be applied to the component
NameTypeDefaultDescription
asStringsets the HTML tag for the component
hrefStringURL to be used for the Link
selectedBooleanUsed to style the link as selected or unselected
sxSystemStyleObject{}Style to be applied to the component
NameTypeDefaultDescription
sxSystemStyleObject{}Style to be applied to the component
Edit this page on GitHub
5 contributorsmperrotticolebemisjfuchsVanAndersonT-Hugs
Last edited by mperrotti on May 5, 2022