Vertical Navigation

View in Lexicon

An alternative patterns that displays navigation items in a vertical menu.

installyarn add @clayui/nav
versionNPM Version
useimport {ClayVerticalNav} from '@clayui/nav';

Example

The markup between the <ClayVerticalNav.Item> tag will render inside the nav-link. In the example below, we are outputting the lock icon next to the label only for non collapsible items.

Custom Trigger

In its mobile version, Vertical Navigation adds a trigger that is responsible for opening the menu, in some cases you may want to customize this trigger, for this use the <ClayVerticalNav.Trigger /> component.

Snippet

Your custom trigger receives the children property with the default content, for cases when you just want to change the Trigger Button and not its content.

Snippet

API Reference

ClayVerticalNav

typeof ClayVerticalNav
Parameters
Properties

itemAriaCurrent

boolean | undefined

Flag to define if the item represents the current page. Disable this attribute only if there are multiple navigations on the page.

activation

"manual" | "automatic" | undefined

Flag to indicate the navigation behavior in the menu.

  • manual - it will just move the focus and menu activation is done just by pressing space or enter.
  • automatic - moves the focus to the menuitem and activates the menu.
Deprecated

activeLabel

string | undefined

Label of item that is currently active.

displayType

DisplayType | undefined

Determines the Vertical Nav variant to use.

decorated

boolean | undefined

Flag to activate the Decorator variation.

triggerLabel

string | undefined= "Menu"

Label of the button that appears on smaller resolutions to open the vertical navigation.

items *

Array<IItemWithItems>

List of items.

large

boolean | undefined

Flag to indicate if menubar-vertical-expand-lg class is applied.

trigger

(({ children, className, ...otherProps }: import("/Users/matuzalemteles/projects/clay/packages/clay-button/lib/Button").ButtonProps) => JSX.Element) | undefined

Custom component that will be displayed on mobile resolutions that toggles the visibility of the navigation.

spritemap

string | undefined

Path to the spritemap that Icon should use when referencing symbols.

active

React.Key | undefined

Flag to define which item has the active state/current page.

aria-label

string | undefined

Flag to define aria-label.

children

React.ReactNode | ((item: string | Record<string, any>, index?: number) => React.ReactElement)

The component contents.

defaultExpandedKeys

Set<React.Key> | undefined

Property to set the initial value of expandedKeys (uncontrolled).

expandedKeys

Set<React.Key> | undefined

The currently expanded keys in the collection (controlled).

onExpandedChange

InternalDispatch<Set<React.Key>> | undefined

A callback that is called when items are expanded or collapsed (controlled).

Returns
Element

Item

typeof Item
Parameters
Properties
Deprecated

active

boolean | undefined

Flag to indicate if item is active.

children

React.ReactNode

The contents of the component.

href

string | undefined

Link href for item.

items

Array<T> | undefined

Property to inform the dynamic data of the tree.

menubarAction

{ ariaLabel: string; title: string; } | undefined

Properties to pass to the menubar action

Returns
Element

Trigger

({ children, className, ...otherProps }: ButtonProps) => JSX.Element
Parameters
ButtonProps
Returns
Element
Edit this page on GitHub

Contributors

Matuzalém Teles, Bryce Osterhaus, Krešimir Čoko, Ilza Medeiros, Patrick Yeo, Diego Nascimento

Last edited May 11, 2025 at 5:57:01 PM