NavigationMenu
A flexible navigation menu component that supports nested items, icons, and different orientations.
View component sourceImport
import { NavigationMenu } from '@app-studio/components';New to the library? Complete installation and provider setup first.
Interactive examples
Try the component, then open Code to copy the complete example.
import React from 'react';
import { NavigationMenu } from '@app-studio/components';
import { Text, Vertical, View } from 'app-studio';
import { HomeIcon, SettingsIcon, UserIcon, NotificationIcon, HelpIcon } from '@app-studio/components';
export const DefaultNavigationMenu = () => {
const items = [
{
id: 'home',
label: 'Home',
icon: <HomeIcon widthHeight={20} />,
href: '/home',
},
{
id: 'settings',
label: 'Settings',
icon: <SettingsIcon widthHeight={20} />,
items: [
{
id: 'profile',
label: 'Profile',
icon: <UserIcon widthHeight={20} />,
href: '/profile',
},
{
id: 'notifications',
label: 'Notifications',
icon: <NotificationIcon widthHeight={20} />,
href: '/notifications',
},
],
},
{
id: 'help',
label: 'Help',
icon: <HelpIcon widthHeight={20} />,
href: '/help',
},
{
id: 'disabled',
label: 'Disabled Item',
disabled: true,
href: '/disabled',
},
];
return (
<Vertical gap={20} width="100%" maxWidth={300}>
<Text marginBottom={10}>Default Navigation Menu (Vertical)</Text>
<View border="1px solid #e2e8f0" borderRadius={8} overflow="hidden">
<NavigationMenu
items={items}
defaultActiveItemId="home"
defaultExpandedItemIds={['settings']}
/>
</View>
</Vertical>
);
};Props
Required props are marked below. A dash indicates an unspecified default. Design system configuration can override implementation defaults.
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
items | NavigationItem[] | — | Items displayed by the component.Source |
children | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | Content rendered inside the component.Source |
orientation | Orientation"horizontal""vertical" | — | See the type and source declaration for this property.Source |
size | Size"sm""md""lg" | — | Size preset for the component.Source |
variant | Variant"outline""default""filled" | — | Visual treatment of the component.Source |
defaultActiveItemId | string | — | See the type and source declaration for this property.Source |
defaultExpandedItemIds | string[] | — | See the type and source declaration for this property.Source |
onItemActivate | ((itemId: string) => void) | — | See the type and source declaration for this property.Source |
views | NavigationMenuStyles | — | Style overrides for the named internal parts.Source |
NavigationMenu.List
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
children Required | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | Content rendered inside the component.Source |
views | { container?: ViewProps; } | — | Style overrides for the named internal parts.Source |
NavigationMenu.Item
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
item | NavigationItem | — | See the type and source declaration for this property.Source |
value | string | — | Current controlled value. Update it from the matching change callback.Source |
isDisabled | boolean | — | Disables user interaction.Source |
children | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | Content rendered inside the component.Source |
views | { item?: ViewProps; trigger?: ViewProps; content?: ViewProps; icon?: ViewProps; indicator?: ViewProps; } | — | Style overrides for the named internal parts.Source |
NavigationMenu.Trigger
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
children Required | React.ReactNode | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | — | Content rendered inside the component.Source |
itemId Required | string | — | See the type and source declaration for this property.Source |
disabled | boolean | — | Disables user interaction.Source |
views | { container?: ViewProps; icon?: ViewProps; trigger?: ViewProps; indicator?: ViewProps; } | — | Style overrides for the named internal parts.Source |
NavigationMenu.Content
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
children Required | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | Content rendered inside the component.Source |
itemId Required | string | — | See the type and source declaration for this property.Source |
views | { container?: ViewProps; } | — | Style overrides for the named internal parts.Source |
NavigationMenu.Link
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
href | string | — | See the type and source declaration for this property.Source |
children Required | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | Content rendered inside the component.Source |
views | { container?: ViewProps; icon?: ViewProps; } | — | Style overrides for the named internal parts.Source |
onClick | ((event: React.MouseEvent) => void) | — | Called when the user activates the component.Source |
isExternal | boolean | — | Opens an external link in a new browsing context.Source |
underline | TextDecorationStyle | — | See the type and source declaration for this property.Source |
iconSize | Size | — | See the type and source declaration for this property.Source |
For shared layout, color, and responsive properties, read Styling & composition and Responsive layouts. Additional native element attributes depend on the target platform.
Usage guidance
- Give controls a visible label or an accessible name, and verify keyboard interaction. See Accessibility.
- For controlled inputs, update the value from the callback shown in the props table. Keep application state in your component or form library.
- These previews run in the browser. Check React Native setup for platform requirements and differences.