A portaled panel for short forms, useful details, or a few actions.
tsx
import { Button } from "@/components/ui/button"import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger,} from "@/components/ui/popover"export function Example() { return ( <Popover> <PopoverTrigger asChild> <Button variant="outline">Open Popover</Button> </PopoverTrigger> <PopoverContent> <PopoverHeader> <PopoverTitle>Dimensions</PopoverTitle> <PopoverDescription> Set the dimensions for the layer. </PopoverDescription> </PopoverHeader> </PopoverContent> </Popover> )}Installation
npx @arctis-sh/@arctis-sh/ui@latest add popoverUsage
import { Button } from "@/components/ui/button"import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger,} from "@/components/ui/popover"<Popover> <PopoverTrigger asChild> <Button variant="outline">Open Popover</Button> </PopoverTrigger> <PopoverContent> <PopoverHeader> <PopoverTitle>Dimensions</PopoverTitle> <PopoverDescription>Set width and height for the canvas.</PopoverDescription> </PopoverHeader> </PopoverContent></Popover>Composition
Popover
├── PopoverTrigger
└── PopoverContent
└── PopoverHeader
├── PopoverTitle
└── PopoverDescriptionBasic
A simple panel with a title and description.
tsx
import { Button } from "@/components/ui/button"import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger,} from "@/components/ui/popover"export function Example() { return ( <Popover> <PopoverTrigger asChild> <Button variant="outline">Open Popover</Button> </PopoverTrigger> <PopoverContent> <PopoverHeader> <PopoverTitle>Dimensions</PopoverTitle> <PopoverDescription> Set the dimensions for the layer. </PopoverDescription> </PopoverHeader> </PopoverContent> </Popover> )}Align
Set align on PopoverContent to start, center, or end relative to the trigger.
tsx
import { Button } from "@/components/ui/button"import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger,} from "@/components/ui/popover"export function Example() { return ( <div className="flex flex-wrap items-center justify-center gap-2"> <Popover> <PopoverTrigger asChild> <Button variant="outline">Start</Button> </PopoverTrigger> <PopoverContent align="start"> <PopoverHeader> <PopoverTitle>Start</PopoverTitle> <PopoverDescription>Aligned to the start.</PopoverDescription> </PopoverHeader> </PopoverContent> </Popover> <Popover> <PopoverTrigger asChild> <Button variant="outline">Center</Button> </PopoverTrigger> <PopoverContent align="center"> <PopoverHeader> <PopoverTitle>Center</PopoverTitle> <PopoverDescription>Aligned to the center.</PopoverDescription> </PopoverHeader> </PopoverContent> </Popover> <Popover> <PopoverTrigger asChild> <Button variant="outline">End</Button> </PopoverTrigger> <PopoverContent align="end"> <PopoverHeader> <PopoverTitle>End</PopoverTitle> <PopoverDescription>Aligned to the end.</PopoverDescription> </PopoverHeader> </PopoverContent> </Popover> </div> )}With Form
Add labeled inputs below the header for a compact form.
tsx
import { Button } from "@/components/ui/button"import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger,} from "@/components/ui/popover"export function Example() { return ( <Popover> <PopoverTrigger asChild> <Button variant="outline">Open Popover</Button> </PopoverTrigger> <PopoverContent> <PopoverHeader> <PopoverTitle>Dimensions</PopoverTitle> <PopoverDescription> Set the dimensions for the layer. </PopoverDescription> </PopoverHeader> <div className="grid gap-3"> <div className="grid gap-1.5"> <label htmlFor="width" className="text-sm tracking-wide"> Width </label> <input id="width" defaultValue="100%" className="h-9 w-full rounded-md border border-border bg-transparent px-3 text-sm tracking-wide text-foreground placeholder:text-muted-foreground" /> </div> <div className="grid gap-1.5"> <label htmlFor="height" className="text-sm tracking-wide"> Height </label> <input id="height" defaultValue="25px" className="h-9 w-full rounded-md border border-border bg-transparent px-3 text-sm tracking-wide text-foreground placeholder:text-muted-foreground" /> </div> </div> </PopoverContent> </Popover> )}API Reference
Popover
| Prop | Type | Default |
|---|---|---|
| open | boolean | — |
| defaultOpen | boolean | false |
| onOpenChange | (open: boolean) => void | — |
<Popover> <PopoverTrigger asChild> <Button variant="outline">Open</Button> </PopoverTrigger> <PopoverContent> <PopoverHeader> <PopoverTitle>Title</PopoverTitle> <PopoverDescription>Description</PopoverDescription> </PopoverHeader> </PopoverContent></Popover>PopoverTrigger
Pass asChild to merge props onto a child element such as Button. Click toggles open state.
| Prop | Type | Default |
|---|---|---|
| asChild | boolean | false |
| className | string | — |
<PopoverTrigger asChild> <Button variant="outline">Open</Button></PopoverTrigger>PopoverContent
Portaled panel. Closes on Escape or outside click.
| Prop | Type | Default |
|---|---|---|
| align | "start" | "center" | "end" | "center" |
| side | "top" | "bottom" | "left" | "right" | "bottom" |
| sideOffset | number | 6 |
| className | string | — |
<PopoverContent> Content</PopoverContent>PopoverHeader
| Prop | Type | Default |
|---|---|---|
| className | string | — |
<PopoverHeader> <PopoverTitle>Title</PopoverTitle> <PopoverDescription>Description</PopoverDescription></PopoverHeader>PopoverTitle
Sets aria-labelledby on the dialog when present.
| Prop | Type | Default |
|---|---|---|
| className | string | — |
<PopoverTitle>Title</PopoverTitle>PopoverDescription
Sets aria-describedby on the dialog when present.
| Prop | Type | Default |
|---|---|---|
| className | string | — |
<PopoverDescription>Description</PopoverDescription>