PopoverMenu
The PopoverMenu component is a combination of the Popover and Menu components. It’s a convenience component for the common use-case of displaying a menu inside a popover.
() => { const [isOpen, setIsOpen] = React.useState(false); return ( <Box position="relative" size="fitContent"> <Button onClick={() => setIsOpen(!isOpen)}>Open Menu</Button> <PopoverMenu open={isOpen} onClose={() => setIsOpen(false)} anchor={{ parent: Origin.bottomLeft, child: Origin.topLeft, offset: { y: "8px" }, }} menu={{ items: [ { label: "Olive-sided Flycatcher" }, { label: "Sage Sparrow" }, { label: "Lark Bunting" }, ], }} /> </Box> ); }
Features
The PopoverMenu component is a convenience component for the common use-case of displaying a menu inside a popover. It combines the Popover and Menu components into a single, easy-to-use component. For more information about their features, see the documentation for each component.
Reference
PopoverMenuProps
The PopoverMenu component accepts all props from the Popover component, except for children.
| Name | Type | Required | Description |
|---|---|---|---|
menu | MenuProps | true | The props to pass to the Menu component. |
Tokens
The PopoverMenu component uses tokens from both the popover and menu components.
Popover
| Key | Default Value |
|---|
Menu
| Key | Default Value |
|---|---|
surface.base.backgroundColor | var(--_1i4ikbk10) |
surface.base.borderRadius | var(--gpqiqdw) |
surface.base.borderWidth | 0 |
surface.base.borderStyle | solid |
surface.base.borderColor | var(--_1i4ikbkx) |
item.base.paddingLeft | var(--gpqiqd9) |
item.base.paddingTop | var(--gpqiqd7) |
item.base.paddingRight | var(--gpqiqd9) |
item.base.paddingBottom | var(--gpqiqd7) |
item.base.borderRadius | 0 |
item.base.backgroundColor | var(--_1i4ikbk10) |
item.base.gap | var(--gpqiqd9) |
item.base.color | var(--_1i4ikbkv) |
item.base.:hover.backgroundColor | color-mix(in srgb, transparent 95%, var(--_1i4ikbkv) 5%) |
item.base.:hover.color | var(--_1i4ikbkv) |
item.base.:focus-visible.backgroundColor | color-mix(in srgb, transparent 95%, var(--_1i4ikbkv) 5%) |
item.base.:focus-visible.color | var(--_1i4ikbkv) |
item.base.:active.backgroundColor | color-mix(in srgb, transparent 95%, var(--_1i4ikbkv) 5%) |
item.base.:active.color | var(--_1i4ikbkv) |
label.base.font | var(--_1i4ikbk28) |
Last updated on