Skip to content
Ballpoint

Native Select

The browser's own select in a drawn box: the platform picker, a drawn outline and chevron.

From shadcn/ui

Installation

pnpm dlx shadcn@latest add @ballpoint/native-select

Usage

tsx
import { NativeSelect, NativeSelectOption } from "@/components/ui/native-select"

<NativeSelect defaultValue="todo">
  <NativeSelectOption value="todo">Todo</NativeSelectOption>
  <NativeSelectOption value="done">Done</NativeSelectOption>
</NativeSelect>

Examples

Groups

Options under headings with NativeSelectOptGroup.

Sizes and states

A shorter size, an invalid select and a disabled one.

The small size is a little shorter.

API reference

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

Height of the box.

className
string

Styles the drawn box (width, margins). Every other prop goes to the <select>.

aria-invalid
boolean

Redraws the box in red pen.

seed
string | number

Pins the drawing.

Pen settings

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