Components
Popover
Non-modal panel anchored to its trigger, with an optional title and description.
import { Button, Popover } from "@openperf/deft";
<Popover.Root>
<Popover.Trigger render={<Button.Root />}>Sampling</Popover.Trigger>
<Popover.Content>
<Popover.Title>Sampling rate</Popover.Title>
<Popover.Description>One in ten transactions is stored.</Popover.Description>
</Popover.Content>
</Popover.Root>;When to use
| Need | Component |
|---|---|
| Detail or a few controls for one element, opened on click | Popover |
| Short hint on hover or focus | Tooltip |
| List of actions | Menu |
| Picking a value | Select or Combobox |
| Task that needs the whole attention of the user | Dialog |
| Long content | Drawer |
Anatomy
<Popover.Root>
<Popover.Trigger /> {/* unstyled — pass a Button through render */}
<Popover.Content>
{/* portal, positioner and popup in one part */}
<Popover.Title />
<Popover.Description />
<Popover.Close /> {/* optional button that closes the popover */}
</Popover.Content>
</Popover.Root>The popup is named by Popover.Title: render one, or pass aria-label to Popover.Content. Every other Base UI Popover export is available on Popover unchanged and unstyled.
Placement
The panel opens below the trigger, 4px away, with their starting edges lined up. Change it with side and align.
API
The popover is not modal: the rest of the page stays interactive while it is open. Set modal on Popover.Root to change that.
Popover.Content
Prop
Type