Menubar
A versatile component for structured navigation, displaying a list of interactive items and their sub-menus.
View component sourceImport
import { Menubar } 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 { Menubar } from '@app-studio/components';
import { View } from 'app-studio';
import { Text } from 'app-studio';
import { EditIcon } from '@app-studio/components';
export const DefaultMenubar = () => {
const items: any[] = [
{
id: 'file',
label: 'File',
items: [
{
id: 'new',
label: 'New',
icon: <EditIcon size={16} />,
onClick: () => console.log('New clicked'),
},
{
id: 'open',
label: 'Open',
onClick: () => console.log('Open clicked'),
},
{ separator: true },
{
id: 'save',
label: 'Save',
onClick: () => console.log('Save clicked'),
},
{
id: 'save-as',
label: 'Save As',
onClick: () => console.log('Save As clicked'),
},
],
},
{
id: 'edit',
label: 'Edit',
items: [
{
id: 'undo',
label: 'Undo',
onClick: () => console.log('Undo clicked'),
},
{
id: 'redo',
label: 'Redo',
onClick: () => console.log('Redo clicked'),
},
{ separator: true },
{
id: 'cut',
label: 'Cut',
onClick: () => console.log('Cut clicked'),
},
{
id: 'copy',
label: 'Copy',
onClick: () => console.log('Copy clicked'),
},
{
id: 'paste',
label: 'Paste',
onClick: () => console.log('Paste clicked'),
},
],
},
{
id: 'view',
label: 'View',
items: [
{
id: 'zoom-in',
label: 'Zoom In',
onClick: () => console.log('Zoom In clicked'),
},
{
id: 'zoom-out',
label: 'Zoom Out',
onClick: () => console.log('Zoom Out clicked'),
},
{ separator: true },
{
id: 'fullscreen',
label: 'Fullscreen',
onClick: () => console.log('Fullscreen clicked'),
},
],
},
{
id: 'help',
label: 'Help',
items: [
{
id: 'documentation',
label: 'Documentation',
onClick: () => console.log('Documentation clicked'),
},
{
id: 'about',
label: 'About',
onClick: () => console.log('About clicked'),
},
],
},
];
return (
<View width="100%">
<Text marginBottom={10}>Default Menubar</Text>
<Menubar items={items} />
</View>
);
};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 Required | MenubarItem[] | — | Items displayed by 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 |
defaultActiveMenuId | string | null | — | See the type and source declaration for this property.Source |
defaultOpenMenuId | string | null | — | See the type and source declaration for this property.Source |
views | MenubarStyles | — | Style overrides for the named internal parts.Source |
Menubar.Root
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 |
orientation | Orientation | — | See the type and source declaration for this property.Source |
size | Size | — | Size preset for the component.Source |
variant | Variant | — | Visual treatment of the component.Source |
views | { container?: ViewProps; } | — | Style overrides for the named internal parts.Source |
Menubar.Menu
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 |
id Required | string | — | See the type and source declaration for this property.Source |
disabled | boolean | — | Disables user interaction.Source |
views | { menu?: ViewProps; } | — | Style overrides for the named internal parts.Source |
Menubar.Trigger
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 |
menuId Required | string | — | See the type and source declaration for this property.Source |
disabled | boolean | — | Disables user interaction.Source |
views | { trigger?: ViewProps; icon?: ViewProps; } | — | Style overrides for the named internal parts.Source |
Menubar.Content
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
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 |
menuId Required | string | — | See the type and source declaration for this property.Source |
views | { content?: ViewProps; item?: ViewProps; icon?: ViewProps; separator?: ViewProps; } | — | Style overrides for the named internal parts.Source |
Menubar.Item
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 |
id Required | string | — | See the type and source declaration for this property.Source |
icon | 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 | — | Icon rendered alongside the content.Source |
disabled | boolean | — | Disables user interaction.Source |
onClick | (() => void) | — | Called when the user activates the component.Source |
views | { item?: ViewProps; icon?: ViewProps; } | — | Style overrides for the named internal parts.Source |
Menubar.Separator
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
views | { separator?: ViewProps; } | — | Style overrides for the named internal parts.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.