NavigationInteractive playground
NavigationMenu
Main navigation with expandable content.
Preparing the playground…
Text and Markdown example
NavigationMenu · Example
1<NavigationMenu><NavigationMenuList><NavigationMenuItem><NavigationMenuLink href="/docs">Documentation</NavigationMenuLink></NavigationMenuItem><NavigationMenuItem><NavigationMenuTrigger>Explore</NavigationMenuTrigger><NavigationMenuContent><NavigationMenuLink href="/docs/componentes/button" style={{display:"block",padding:24}}>Button →</NavigationMenuLink></NavigationMenuContent></NavigationMenuItem></NavigationMenuList></NavigationMenu>How to use it
Use NavigationMenuLink for destinations and Trigger with Content for groups. Keep clear names and keyboard navigation.
Import
React / Next.js
1import { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuLink, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuViewport } from "@kivora/nextjs";Interactive examples run inside a component with "use client". The playground's Copy button includes the imports needed for the current example.
API reference 0.2.0
Types from the installed published version, including component properties and common HTML attributes. “Optional” does not imply a default value; omitting a property lets the component decide.
| Property | Type | Description |
|---|---|---|
aria-label | string | Accessible name of the control. |
asChild | boolean | Apply props and behavior to a single compatible child element. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
defaultChecked | boolean | Initial selection of the control. |
defaultValue | string | Initial value when the component manages its own state. |
delayDuration | number | The duration from when the pointer enters the trigger until the tooltip gets opened. |
dir | "ltr" | "rtl" | Interface reading direction. |
id | string | Element identifier; associates labels and descriptions. |
onChange | ChangeEventHandler<HTMLElement, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | MouseEventHandler<HTMLElement> | Action performed when the element is activated. |
onSubmit | SubmitEventHandler<HTMLElement> | Form submission event. |
onValueChange | ((value: string) => void) | Receives the value after an interaction. |
orientation | "horizontal" | "vertical" | Horizontal or vertical axis. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
skipDelayDuration | number | How much time a user has to enter another trigger without incurring a delay again. |
style | CSSProperties | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
title | string | Title or supplementary information. |
value | string | Controlled value. Update it from the change callback. |
Subcomponents and composition
Review each component's properties and published declaration. Native and accessibility attributes are inherited from the element specified by its type.
NavigationMenu20 properties
NavigationMenu · TypeScript
1NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>NavigationMenuList14 properties
| Property | Type | Description |
|---|---|---|
aria-label | string | Accessible name of the control. |
asChild | boolean | Apply props and behavior to a single compatible child element. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
defaultChecked | boolean | Initial selection of the control. |
defaultValue | string | number | readonly string[] | Initial value when the component manages its own state. |
id | string | Element identifier; associates labels and descriptions. |
onChange | ChangeEventHandler<HTMLUListElement, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | MouseEventHandler<HTMLUListElement> | Action performed when the element is activated. |
onSubmit | SubmitEventHandler<HTMLUListElement> | Form submission event. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
style | CSSProperties | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
title | string | Title or supplementary information. |
NavigationMenuList · TypeScript
1NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>NavigationMenuItem15 properties
| Property | Type | Description |
|---|---|---|
aria-label | string | Accessible name of the control. |
asChild | boolean | Apply props and behavior to a single compatible child element. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
defaultChecked | boolean | Initial selection of the control. |
defaultValue | string | number | readonly string[] | Initial value when the component manages its own state. |
id | string | Element identifier; associates labels and descriptions. |
onChange | ChangeEventHandler<HTMLLIElement, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | MouseEventHandler<HTMLLIElement> | Action performed when the element is activated. |
onSubmit | SubmitEventHandler<HTMLLIElement> | Form submission event. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
style | CSSProperties | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
title | string | Title or supplementary information. |
value | string | Controlled value. Update it from the change callback. |
NavigationMenuItem · TypeScript
1NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>NavigationMenuLink17 properties
| Property | Type | Description |
|---|---|---|
active | boolean | Configures active. The type describes the supported values and structure. |
aria-label | string | Accessible name of the control. |
asChild | boolean | Apply props and behavior to a single compatible child element. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
defaultChecked | boolean | Initial selection of the control. |
defaultValue | string | number | readonly string[] | Initial value when the component manages its own state. |
id | string | Element identifier; associates labels and descriptions. |
onChange | ChangeEventHandler<HTMLAnchorElement, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | MouseEventHandler<HTMLAnchorElement> | Action performed when the element is activated. |
onSelect | ((event: Event) => void) | Action or selection made by the user. |
onSubmit | SubmitEventHandler<HTMLAnchorElement> | Form submission event. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
style | CSSProperties | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
title | string | Title or supplementary information. |
type | string | Operation type or mode; values depend on the component. |
NavigationMenuLink · TypeScript
1NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>NavigationMenuTrigger18 properties
| Property | Type | Description |
|---|---|---|
aria-label | string | Accessible name of the control. |
asChild | boolean | Apply props and behavior to a single compatible child element. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
defaultChecked | boolean | Initial selection of the control. |
defaultValue | string | number | readonly string[] | Initial value when the component manages its own state. |
disabled | boolean | Disable interaction with the control. |
id | string | Element identifier; associates labels and descriptions. |
name | string | Name used to identify the control in forms. |
onChange | ChangeEventHandler<HTMLButtonElement, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | MouseEventHandler<HTMLButtonElement> | Action performed when the element is activated. |
onSubmit | SubmitEventHandler<HTMLButtonElement> | Form submission event. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
style | CSSProperties | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
title | string | Title or supplementary information. |
type | "button" | "submit" | "reset" | Operation type or mode; values depend on the component. |
value | string | number | readonly string[] | Controlled value. Update it from the change callback. |
NavigationMenuTrigger · TypeScript
1NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>NavigationMenuContent20 properties
| Property | Type | Description |
|---|---|---|
aria-label | string | Accessible name of the control. |
asChild | boolean | Apply props and behavior to a single compatible child element. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
defaultChecked | boolean | Initial selection of the control. |
defaultValue | string | number | readonly string[] | Initial value when the component manages its own state. |
deferPointerDownOutside | boolean | When `true`, a `'pointerdown'` event outside of the layered element will wait for the interaction's click event before dispatching, allowing third-party code to stop propagation of later events and cancel dismissal. |
forceMount | true | Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. |
id | string | Element identifier; associates labels and descriptions. |
onChange | ChangeEventHandler<HTMLDivElement, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | MouseEventHandler<HTMLDivElement> | Action performed when the element is activated. |
onEscapeKeyDown | ((event: KeyboardEvent) => void) | Event handler called when the escape key is down. Can be prevented. |
onFocusOutside | ((event: FocusOutsideEvent) => void) | Event handler called when the focus moves outside of the `DismissableLayer`. Can be prevented. |
onInteractOutside | ((event: PointerDownOutsideEvent | FocusOutsideEvent) => void) | Event handler called when an interaction happens outside the `DismissableLayer`. Specifically, when a `pointerdown` event happens outside or focus moves outside of it. Can be prevented. |
onPointerDownOutside | ((event: PointerDownOutsideEvent) => void) | Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. Can be prevented. |
onSubmit | SubmitEventHandler<HTMLDivElement> | Form submission event. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
style | CSSProperties | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
title | string | Title or supplementary information. |
NavigationMenuContent · TypeScript
1NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>NavigationMenuIndicator15 properties
| Property | Type | Description |
|---|---|---|
aria-label | string | Accessible name of the control. |
asChild | boolean | Apply props and behavior to a single compatible child element. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
defaultChecked | boolean | Initial selection of the control. |
defaultValue | string | number | readonly string[] | Initial value when the component manages its own state. |
forceMount | true | Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. |
id | string | Element identifier; associates labels and descriptions. |
onChange | ChangeEventHandler<HTMLDivElement, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | MouseEventHandler<HTMLDivElement> | Action performed when the element is activated. |
onSubmit | SubmitEventHandler<HTMLDivElement> | Form submission event. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
style | CSSProperties | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
title | string | Title or supplementary information. |
NavigationMenuIndicator · TypeScript
1NavigationMenuIndicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>NavigationMenuViewport15 properties
| Property | Type | Description |
|---|---|---|
aria-label | string | Accessible name of the control. |
asChild | boolean | Apply props and behavior to a single compatible child element. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
defaultChecked | boolean | Initial selection of the control. |
defaultValue | string | number | readonly string[] | Initial value when the component manages its own state. |
forceMount | true | Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. |
id | string | Element identifier; associates labels and descriptions. |
onChange | ChangeEventHandler<HTMLDivElement, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | MouseEventHandler<HTMLDivElement> | Action performed when the element is activated. |
onSubmit | SubmitEventHandler<HTMLDivElement> | Form submission event. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
style | CSSProperties | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
title | string | Title or supplementary information. |
NavigationMenuViewport · TypeScript
1NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>API generated from @kivora/nextjs 0.2.0View package