npx gluestack-ui add menuimport {
Menu,
MenuItem,
MenuItemLabel,
MenuSeparator,
} from '@/components/ui/menu';


export default () => (
<Menu>
<MenuItem>
<MenuItemLabel />
</MenuItem>
<MenuSeparator />
</Menu>
);
| Prop | Type | Default | Description |
|---|---|---|---|
trigger | (_props: any, state: { open: boolean; }) => Element | - | Function that returns a React Element. This element will be used as a Trigger for the Menu |
placement | "bottom" | "top" | "right" | "left" | "top left" | "top right" | "bottom left" | "bottom right" | "right top" | "right bottom" | "left top" | "left bottom" | bottom left | Menu placement |
defaultIsOpen | boolean | false | If true, the menu will be opened by default |
onOpen | () => void | - | This function will be invoked when the menu is opened |
onClose | () => void | - | This function will be invoked when menu is closed |
isOpen | boolean | false | Whether the menu is opened. Useful for controlling the open state |
offset | number | - | The additional offset applied along the main axis |
crossOffset | number | - | The additional offset applied along the cross axis |
disabledKeys | string[] | - | Item keys in this collection will be disabled |
closeOnSelect | boolean | true | Whether menu is closed after option is selected |
selectedKeys | 'all' | Iterable<Key> | - | The currently selected keys in the collection (controlled) |
selectionMode | 'none' | 'single' | 'multiple' | none | The type of selection that is allowed in the collection |
onSelectionChange | (keys: 'all' | Iterable<Key>) => void | - | Handler that is called when the selection changes |