Popover
A small panel that opens from a button and can hold controls.
- Use it for
- Interactive content anchored to a trigger, such as a small form or filter.
Popover preview
Open the panel to review its content.
Installation
npm install @stackunseen/uiimport { Popover } from '@stackunseen/ui';@stackunseen/ui/styles.cssParts
A small panel that opens from a button and can hold controls. Focus and closing on Escape or outside clicks are handled for you.
How the parts fit together
<Popover open={open} onOpenChange={setOpen}>
<Popover.Trigger asChild>
<Button variant="outline">Project details</Button>
</Popover.Trigger>
<Popover.Content title="Project details">
{/* fields */}
<Popover.Close asChild>
<Button>Done</Button>
</Popover.Close>
</Popover.Content>
</Popover>PopoverHolds the open state; leave it uncontrolled or pass
openandonOpenChange.Popover.TriggerOpens it. Pass your own Button with
asChild.Popover.ContentThe panel;
titleis its heading.Popover.CloseA button that closes it, such as Done.
Popover.ArrowAn optional pointer toward the trigger.
Usage and props
Keep whether it’s open, and any draft, in your app. Use it for short tasks; move longer ones into a dialog or a page.
Supported inputs
This is the public signature used by this example. Open Code to see how the values and callbacks fit together.
Root: open? · onOpenChange? · Content: title · description? · headingLevel? · Trigger/Close asChild?All props
Loading…
For your coding agent
Give the agent this page instead of a screenshot. The prompt wraps the page with the install and import lines and the rule that your server, not a click, completes an action.
- Contract
- Root: open? · onOpenChange? · Content: title · description? · headingLevel? · Trigger/Close asChild?
- Keeps honest
- Keep whether it’s open, and any draft, in your app. Use it for short tasks; move longer ones into a dialog or a page.
- MCP
read_component "Popover"on the docs endpoint
Keyboard and customization
Keyboard
Enter or Space opens the trigger. Focus moves into the panel; Escape closes it and returns focus.
Customization
Change shared colors, spacing, corners and icons with the theme. Use the component's supported props to adapt its content and layout. Customization guide and Theme Studio