← Inventory
Popover
Root component for a popover (non-modal floating panel). Manages open/closed state.
Usage
@desk/ui/components/popover
<Popover>
<PopoverTrigger asChild>
<Button emphasis="outline" tone="neutral">
Finish
</Button>
</PopoverTrigger>
<PopoverContent>
<Stack gap="sm">
<Text size="sm" weight="semibold">
Finish
</Text>
<Text size="xs" variant="muted">
Applies to every swatch in this palette.
</Text>
<Flex gap="xs" wrap="wrap">
<Button emphasis="soft" size="sm" tone="neutral">
Matte
</Button>
<Button emphasis="outline" size="sm" tone="neutral">
Polished
</Button>
<Button emphasis="outline" size="sm" tone="neutral">
Honed
</Button>
</Flex>
</Stack>
</PopoverContent>
</Popover>Best practices
Use
Popoverfor an anchored non-blocking panel dismissed on outside-click / Esc; a page-blocking modal is aDialog, a menu of actions is aDropdownMenu.It's non-modal by default (
modal={false}) so the page stays interactive — passmodalonly when you must trap focus and block the background.PopoverContentportals to the body; anchor to a non-trigger element withPopoverAnchor.
Props
PopoverArrow
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string |
PopoverContent
| Prop | Type | Default | Description |
|---|---|---|---|
| size | PopoverSize |
Also exports
- component
Popover - const
popoverAnatomy - component
PopoverAnchor - component
PopoverTrigger
Anatomy
Popover
popoverFloating content panel
PopoverTrigger
popover-triggerElement that opens popover
PopoverContent
popover-contentPopover content area
PopoverAnchor
popover-anchorOptional positioning anchor