shadcn.io is an independent project built on shadcn/ui
Open shows a title that reads Title and the line Content goes here. Cancel and Confirm sit at the end of the panel. Both close it.
Use it for a quick confirm tied to one control. A decision that cannot be undone belongs in an Alert Dialog. In Svelte, Ark UI does not perform the confirm.
Installation
Anatomy

Usage
<Popover><PopoverTrigger>{#snippet asChild(props)}<Button {...props()} variant="outline">Open</Button>{/snippet}</PopoverTrigger><PopoverContent><PopoverHeader><PopoverTitle>Title</PopoverTitle><PopoverDescription>Content goes here.</PopoverDescription></PopoverHeader><div class="flex justify-end gap-2"><PopoverClose>{#snippet asChild(props)}<Button {...props()} size="sm" variant="outline">Cancel</Button>{/snippet}</PopoverClose><PopoverClose>{#snippet asChild(props)}<Button {...props()} size="sm">Confirm</Button>{/snippet}</PopoverClose></div></PopoverContent></Popover>FAQ
How are Cancel and Confirm arranged?
They sit in a div with flex justify-end gap-2. Both are size="sm": Cancel uses variant="outline" and Confirm the default variant. Either one closes the panel.
How do I close this panel from code?
Cancel and Confirm close the panel.
Here each button sits in PopoverClose, which closes the panel without any state. To close it from your own code, control the open state on Popover.
Pass open and onOpenChange on Popover. The callback gets { open }.
What is the text above the buttons?
PopoverHeader wraps PopoverTitle reading Title and PopoverDescription reading Content goes here. The button row is the next block in PopoverContent.
How does the Open button become the trigger?
The trigger is a Button with variant="outline" and the label Open. Activating it opens the panel. The footer buttons are what set open back to false.
asChild is a snippet on PopoverTrigger that renders the button, and PopoverContent is the panel.
API Reference
Popover
No extra props in this demo. The rest is on the Popover page.
Button
Sets props, variant="outline" and size="sm". The rest is on the Button page.





