A floating panel anchored to a button, for filters and quick edits.
import { Popover, PopoverTrigger, PopoverContent, PopoverClose } from "kivu-ui"On this page
import { Popover, PopoverTrigger, PopoverContent, PopoverClose } from "kivu-ui";import { Button, Checkbox, Popover, PopoverClose, PopoverContent, PopoverTrigger } from "kivu-ui";
export default function Demo() {
return (
<Popover>
<PopoverTrigger asChild>
<Button variant="outline">Filters</Button>
</PopoverTrigger>
<PopoverContent align="start" className="w-64">
<p className="mb-3 text-sm font-semibold">Status</p>
<div className="grid gap-2">
<Checkbox label="Active" defaultChecked />
<Checkbox label="Trialing" defaultChecked />
<Checkbox label="Cancelled" />
</div>
<div className="mt-4 flex justify-end">
<PopoverClose asChild>
<Button size="sm">Apply</Button>
</PopoverClose>
</div>
</PopoverContent>
</Popover>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | - | Open state (controlled). |
defaultOpen | boolean | false | Initial open state (uncontrolled). |
onOpenChange | (open: boolean) => void | - | Called when it opens or closes. |
Extends <button> attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Render the single child (e.g. a router Link) with this trigger's styles and behaviour. |
Extends <div> attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
side | "top" | "bottom" | "left" | "right" | "bottom" | Preferred side; flips when there isn't room. |
align | "start" | "center" | "end" | "start" | Alignment along the trigger. |
offset | number | 6 | Gap from the trigger, in px. |
autoFocus | boolean | true | Move focus into the panel when it opens. |
Extends <button> attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Render the single child (e.g. a router Link) with this button's styles and behaviour. |
Every component also accepts className and forwards its ref. Root CSS class: .kivu-popover