React Native Mantine › Overlays
Menubar
Horizontal bar of menus, one opened at a time
Import: import { Menubar } from 'react-native-mantine';
Usage
import { Menubar } from 'react-native-mantine';
// Only one menu can be opened at a time
<Menubar onOpenChange={(index) => console.log(index)}>
<Menubar.Menu target={<Button>File</Button>} width={200}>
<Menubar.Label>File</Menubar.Label>
<Menubar.Item onPress={newFile}>New file</Menubar.Item>
<Menubar.Divider />
<Menubar.Item onPress={save}>Save</Menubar.Item>
</Menubar.Menu>
<Menubar.Menu target={<Button>Edit</Button>} width={200}>
<Menubar.Item onPress={undo}>Undo</Menubar.Item>
<Menubar.Item disabled>Redo</Menubar.Item>
</Menubar.Menu>
</Menubar>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children (required) | ReactNode | Item content | |
icon | ReactNode | Icon displayed on the left side | |
color | MantineColor | Item color from theme | |
onPress | () => void | Called when item is pressed | |
disabled | boolean | false | Disabled state |