Skip to content
Ballpoint

Input

A text field in a drawn box, or on the line you write on. Focus draws one more pass in full ink; invalid redraws it in red pen.

From shadcn/ui
Built on Base UI Input

That code has already been used.

Installation

pnpm dlx shadcn@latest add @ballpoint/input

Usage

tsx
import { Input } from "@/components/ui/input"

<Input type="email" placeholder="you@example.com" />

Examples

Types

Password, number, search and file inputs, each with a field label and hint.

Use a phrase you could write from memory.

States

Read-only, disabled, and invalid in the box or on the line.

You can select it and copy it, but not change it.

With a button

An email field and a submit button on one row.

A leading icon, a shortcut hint that goes when you type, and a filtered list.

/
  • Cream notebook
  • Blue ballpoint
  • Legal pad
  • Fineliner set
  • Graph pad
  • Pencil case

API reference

variant
default "box"
"box" | "line"

Drawn around the field, or the line you write on.

className
string

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

aria-invalid
boolean

Redraws the box in red pen.

seed
string | number

Pins the drawing.

Every other prop goes to Base UI's Input.

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.