Navigation Menu

A cross-browser solution for styled scroll areas: it relies on native scrolling for accessibility and performance while exposing parts (viewport, scrollbar, thumb, corner) for styling.

@radix-ui/react-navigation-menu

class-variance-authority lucide-react

Installation


1

Install the following dependencies:

npx shadcn@latest add https://sbthemes.com/r/navigation-menu.json

Examples


Default


API Reference

Root

The toggle.

PropTypeDefault
defaultValuestring-
valuestring-
delayDurationnumber200
skipDelayDurationnumber300
directionltr, rtlltr
orientationvertical, horizontalvertical
Data attributeValues
[data-orientation]vertical, horizontal

Sub

Signifies a submenu. Use it in place of the root part when nested to create a submenu.

PropTypeDefault
defaultValuestring-
valuestring-
onValueChangefunction (value: string) => void-
orientationvertical, horizontalvertical
Data attributeValues
[data-orientation]vertical, horizontal

List

Contains the top level menu items.

PropTypeDefault
asChildbooleanfalse
Data attributeValues
[data-orientation]vertical, horizontal