Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
NavigationMenu ├── NavigationMenuList │ └── NavigationMenuItem │ ├── NavigationMenuLink │ └── NavigationMenuTrigger │ └── NavigationMenuContent ├── NavigationMenuIndicator (optional) └── NavigationMenuViewport (optional)
Examples
Default
Loading...
Featured
Loading...
Grid
Loading...
Groups
Loading...
With Icons
Loading...
API Reference
NavigationMenu
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | undefined | — | Unique identifier used to connect the component parts. |
translations | IntlTranslations | undefined | — | Configures translations. |
ids | ElementIds | undefined | — | Overrides generated identifiers for individual parts. |
value | string | undefined | — | Current value when the component is controlled. |
defaultValue | string | undefined | — | Initial value when the component is uncontrolled. |
onValueChange | ((details: ValueChangeDetails) => void) | undefined | — | Runs when value changes. |
openDelay | number | undefined | — | Configures open delay. |
closeDelay | number | undefined | — | Configures close delay. |
disableClickTrigger | boolean | undefined | — | Configures disable click trigger. |
disableHoverTrigger | boolean | undefined | — | Configures disable hover trigger. |
disablePointerLeaveClose | boolean | undefined | — | Configures disable pointer leave close. |
Context, Hooks, and Types
| Export | API |
|---|---|
NavigationMenuContext | Render-prop component that exposes component state and actions. |
NavigationMenuRootProvider | Provides an externally created API to the component tree. |
useNavigationMenu | Creates or accesses the component API. |
useNavigationMenuContext | Returns the nearest component API. |
Utilities and Supporting Types
| Export | API |
|---|---|
navigationMenuTriggerStyle | Supporting type or utility exported with the component. |
Angular
React
Solid
Svelte
Vue