Skip to content
Ballpoint

Popover

A slip of paper held up next to its trigger, pencilled round and lifted off its shadow.

From shadcn/ui
Built on Base UI Popover

Installation

pnpm dlx shadcn@latest add @ballpoint/popover

Usage

tsx
import { Button } from "@/components/ui/button"
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"

<Popover>
  <PopoverTrigger render={<Button variant="outline" />}>Open</PopoverTrigger>
  <PopoverContent>Place content here.</PopoverContent>
</Popover>

Examples

Account menu

An avatar that opens a small card of actions.

A small form

Two fields with their labels, opened from a button.

A picker

Choose from a radio group; the trigger shows the choice and the popover closes.

API reference

side
default "bottom"
"top" | "right" | "bottom" | "left" | "inline-start" | "inline-end"

On PopoverContent: which side of the trigger it opens on.

align
default "center"
"start" | "center" | "end"

How it lines up with the trigger along that side.

sideOffset / alignOffset
default 8 / 0
number

Gap from the trigger, and nudge along it, in px.

seed
string | number

Pins the drawing.

Every other prop goes to Base UI's Popover.

Pen settings

The drawing also takes draw, roughness, passes, radius, corners, shadow, weight and speed, as props or from the nearest InkProvider. What each one does.