Nav

Examples

Simple Nav

Copied to clipboard

Grouped Nav

Copied to clipboard

Default Nav

Copied to clipboard

Expandable Nav

Copied to clipboard

Expandable Nav (w/subnav titles)

Copied to clipboard

Nav Mixed

Copied to clipboard

Horizontal List

Copied to clipboard

Tertiary List

Copied to clipboard

Nav Props

The Nav component accepts the following props.

NameTypeRequiredDefaultDescription
children
node
nullAnything that can be rendered inside of the nav
className
string
''Additional classes added to the container
onSelect
func
() => undefinedCallback for updating when item selection changes
onToggle
func
() => undefinedCallback for when a list is expanded or collapsed
aria-label
string
Accessibility label

NavGroup Props

The NavGroup component accepts the following props.

NameTypeRequiredDefaultDescription
title
string
Title shown for the group
children
node
nullAnything that can be rendered inside of the group
className
string
''Additional classes added to the container
id
string
''Identifier to use for the section aria label

NavList Props

The NavList component accepts the following props.

NameTypeRequiredDefaultDescription
variant
enum: default, simple, horizontal, tertiary
'default'Indicates the list type.
children
node
nullChildren nodes
className
string
''Additional classes added to the list

NavExpandable Props

The NavExpandable component accepts the following props.

NameTypeRequiredDefaultDescription
title
string
Title shown for the expandable list
srText
string
''If defined, screen readers will read this text instead of the list title
isExpanded
bool
falseIf true will default the list to be expanded
children
node
nullAnything that can be rendered inside of the expandable list
className
string
''Additional classes added to the container
groupId
string | number
nullGroup identifier, will be returned with the onToggle and onSelect callback passed to the Nav component
isActive
bool
falseIf true makes the expandable list title active
id
string
''Identifier to use for the section aria label

NavItem Props

The NavItem component accepts the following props.

NameTypeRequiredDefaultDescription
children
node
nullContent rendered inside the nav item
className
string
''Additional classes added to the nav item
to
string
''Target navigation link
isActive
bool
falseFlag indicating whether the item is active
groupId
string | number
nullGroup identifier, will be returned with the onToggle and onSelect callback passed to the Nav component
itemId
string | number
nullItem identifier, will be returned with the onToggle and onSelect callback passed to the Nav component
preventDefault
bool
falseIf true prevents the default anchor link action to occur. Set to true if you want to handle navigation yourself.
onClick
func
nullCallback for item click