Navigation Menu
Navigation Menu Primitive
Demo
Shows a collection of navigation links.
Installation
Copy/paste the following code to ~/components/ui/navigation-menu.tsx
:
Usage
Props
NavigationMenuRoot
Extends View
props
Prop | Type | Note |
---|---|---|
value* | boolean | |
onValueChange* | (value: boolean) => void | |
asChild | boolean | (optional) |
delayDuration | number | Web only (optional) |
skipDelayDuration | number | Web only (optional) |
dir | ’ltr’ | ‘rtl’ | Web only (optional) |
orientation | ’horizontal’ | ‘vertical’ | Web only (optional) |
NavigationMenuList
Extends View
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
NavigationMenuItem
Extends Pressable
props
Prop | Type | Note |
---|---|---|
value* | string | |
asChild | boolean | (optional) |
NavigationMenuTrigger
Extends Pressable
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
NavigationMenuContent
Extends View
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
forceMount | true | undefined | (optional) |
alignOffset | number | Native Only (optional) |
insets | Insets | Native Only (optional) |
avoidCollisions | boolean | Native Only (optional) |
align | ’start’ | ‘center’ | ‘end’ | Native Only (optional) |
side | ’top’ | ‘bottom’ | Native Only (optional) |
sideOffset | number | Native Only (optional) |
disablePositioningStyle | boolean | Native Only (optional) |
loop | boolean | Web Only (optional) |
onEscapeKeyDown | (event: KeyboardEvent) => void | Web Only (optional) |
onPointerDownOutside | (event: PointerDownOutsideEvent) => void | Web Only (optional) |
onFocusOutside | (event: FocusOutsideEvent) => void | Web Only (optional) |
onInteractOutside | PointerDownOutsideEvent | FocusOutsideEvent | Web Only (optional) |
NavigationMenuLink
Extends Pressable
props
Prop | Type | Note |
---|---|---|
active | boolean | (optional) |
asChild | boolean | (optional) |
NavigationMenuViewport
Should only be used for web
Extends View
props except children
NavigationMenuIndicator
Extends View
props