Rich content in a floating panel, anchored to a trigger.
$ pnpm dlx shadcn@latest add https://dashral.com/r/popover.jsonInstallation
$ pnpm dlx shadcn@latest add https://dashral.com/r/popover.jsonAdds the component, the components it builds on, its npm packages and the theme tokens it uses. Using Dashral often? Add the registry to components.json once:
components.json
{
"registries": {
"@dashral": "https://dashral.com/r/{name}.json"
}
}Then add components by name:
$ pnpm dlx shadcn@latest add @dashral/popoverUsage
example.tsx
import { Button } from "@/components/dashral/button"
import { Input } from "@/components/dashral/input"
import { Popover } from "@/components/dashral/popover"
<Popover trigger={<Button variant="outline">Filters</Button>} className="w-72">
<Input label="Customer" placeholder="Name or email" />
</Popover>Examples
API reference
Popover
Also takes every prop of Radix Popover(opens in a new tab).
| Prop | Type | Default |
|---|---|---|
trigger | ReactElementWhat opens it, e.g. a button. Required. | — |
children | ReactNodeThe panel's content. | — |
side / align | Where it opens. | "bottom" / "center" |
open / onOpenChange | Control it yourself. | — |
className | stringThe panel's classes, e.g. a width or p-0. | — |
PopoverRoot / PopoverTrigger / PopoverAnchor / PopoverContent
Building blocks, for a control of your own: Combobox and DatePicker are made from them.
Also takes every prop of Radix Popover(opens in a new tab).
Keyboard
| Keys | Action |
|---|---|
| TaborShift+Tab | Move between controls; focus stays inside while it's open |
| Escape | Close and return focus to what opened it |
Accessibility
- The trigger has aria-expanded and aria-controls; focus moves into the content and back.
Motion
- Opens with a fade, a scale from 95%, a 2px blur clearing and a 4px slide from its trigger's side, on the spring (--duration-standard); closes faster (--duration-fast, --ease-exit). No blur with reduced motion.