Skip to content
Ballpoint

Select

A drawn box with a chevron that opens a slip of choices, the chosen one ticked.

From shadcn/ui
Built on Base UI Select

Installation

pnpm dlx shadcn@latest add @ballpoint/select

Usage

tsx
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"

const pens = [
  { label: "Blue ballpoint", value: "blue" },
  { label: "Black fineliner", value: "black" },
]

<Select items={pens}>
  <SelectTrigger aria-label="Pen" className="w-52">
    <SelectValue placeholder="Pick a pen" />
  </SelectTrigger>
  <SelectContent>
    {pens.map((pen) => (
      <SelectItem key={pen.value} value={pen.value}>
        {pen.label}
      </SelectItem>
    ))}
  </SelectContent>
</Select>

Examples

In a form

With a label, a hint, and an invalid state.

Used for printing and export.

Controlled

Read the chosen value from state.

Writing in blue.

With a note

Each option carries a few words of what it means.

Sizes

The small and default triggers, side by side with their labels.

API reference

Select items
{ label, value }[]

Lets SelectValue show the chosen item's label rather than its value.

SelectTrigger size
default "default"
"default" | "sm"

Height and type size, matching Input.

SelectContent alignItemWithTrigger
default true
boolean

Opens over the trigger with the chosen item lined up on it, like a native select. False drops it below.

seed
string | number

On SelectTrigger and SelectContent: pins the drawing.

Every other prop goes to Base UI's Select.

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.