structyl

Navigation Menu API

View component

The full prop reference for the Navigation Menu component. A collection of links for navigating a website.

Import

tsx
import { NavigationMenu } from '@structyl/styled';

Props

Root

Root container for the navigation menu system. Manages state, timing, and direction. Accepts nav element props.

PropTypeDefault
value#string

Controlled active menu item value

defaultValue#string

Initial active menu item value (uncontrolled)

onValueChange#(value: string) => void

Callback when the active menu item changes

delayDuration#number

Delay in ms before opening submenu on hover when first trigger is activated

200
skipDelayDuration#number

Delay in ms before resuming open delay after all menus close

300
dir#'ltr' | 'rtl'

Text direction (left-to-right or right-to-left)

orientation#'horizontal' | 'vertical'

Layout direction of menu items

'horizontal'
asChild#boolean

Render as child element instead of nav

className#string

CSS class name

List

Container for navigation menu items. Accepts ul element props.

PropTypeDefault
className#string

CSS class name

Item

Container for a menu item (trigger + content pair). Accepts li element props.

PropTypeDefault
value#string

Unique identifier for this menu item (auto-generated if not provided)

asChild#boolean

Render as child element instead of li

className#string

CSS class name

Trigger

Button that opens/closes the menu content. Accepts button element props.

PropTypeDefault
asChild#boolean

Render as child element instead of button

className#string

CSS class name

Content

Container for menu item content shown when trigger is active. Accepts div element props.

PropTypeDefault
forceMount#boolean

Force mounting content in DOM even when closed

asChild#boolean

Render as child element instead of div

className#string

CSS class name

Indicator

Visual indicator element (typically animated arrow/chevron). Accepts div element props.

PropTypeDefault
forceMount#boolean

Force mounting indicator in DOM even when hidden

className#string

CSS class name

Viewport

Viewport container that constrains content size and position. Accepts div element props.

PropTypeDefault
forceMount#boolean

Force mounting viewport in DOM even when closed

className#string

CSS class name

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library