# Ballpoint
> shadcn-style React components drawn in blue ballpoint, on Base UI. Same names and props as shadcn/ui; every border, fill, rule and icon is a seeded pen stroke. Installed with the shadcn CLI as source you own. React 19, Tailwind CSS 4, MIT.
Strokes are generated from a seed, so a component draws the same wobble on the server and in the browser. By default everything draws itself in the first time it scrolls into view, and what comes into view together is drawn in reading order, each drawing starting as the one before gets under way. Content with no drawing of its own takes its turn with `useInkStage()` (spread it onto the element; children with the `ink-land` class settle in when the pen gets there). With reduced motion everything appears already drawn.
Everything is one ink at different pressures on one paper. Change `--ink` and `--paper` and the rest follows; shadcn's own token names (`--background`, `--primary`, `--border`, …) are mapped onto these, so shadcn blocks sit on the same page.
Site: https://ballpoint.st9wd.com
Source: https://github.com/useit015/ballpoint
## Installation
Ballpoint is a shadcn registry: the CLI copies the components into your app and you own them. It needs React 19 and Tailwind CSS 4; the examples assume Next.js.
1. Set up the paper and ink. In an app that already has Tailwind CSS 4, run init with the Ballpoint base. It writes the colour, type and motion tokens into your global CSS, adds Gaegu with next/font, copies the stroke engine into lib/ and hooks/, and registers the @ballpoint namespace in components.json.
```bash
npx shadcn@latest init https://ballpoint.st9wd.com/r/ballpoint.json
```
2. Add components.
```bash
npx shadcn@latest add @ballpoint/button
```
```tsx
import { Button } from "@/components/ui/button"
```
## For agents
Ballpoint ships its craft for coding agents: a skill that teaches it, an MCP server that looks things up, makes looks and runs the red pen, and four commands.
- Claude Code plugin (skill, MCP server and commands): `/plugin install ballpoint --marketplace useit015/ballpoint` (before Claude Code 2.1.275: `/plugin marketplace add useit015/ballpoint` then `/plugin install ballpoint@ballpoint`)
- MCP server only: `claude mcp add --transport http ballpoint https://ballpoint.st9wd.com/mcp` (Codex: `codex mcp add ballpoint --url https://ballpoint.st9wd.com/mcp`)
- Skill only: `npx skills add useit015/ballpoint`, or into this project with `npx shadcn@latest add @ballpoint/skill`
Commands (slash commands in the plugin, prompts on the MCP server):
- `/ballpoint:draw `: Draw a screen with Ballpoint, in the craft, and check it with the red pen.
- `/ballpoint:convert`: Move a shadcn/ui app over to Ballpoint: same names and props, so mostly a redraw.
- `/ballpoint:look `: Pick or make a look (ink, paper, ruling, hand, face) that passes WCAG AA, and install it.
- `/ballpoint:critique [path]`: Read files against the craft rules and mark them up like a teacher's red pen.
Every page of the docs is also markdown: add `.md` to its address (https://ballpoint.st9wd.com/docs/button.md).
## The craft
What makes a screen look drawn rather than shadcn in a handwriting font. Corrections (✗) are what the red pen goes through; notes (·) are advice in the margin.
### ✗ One ink
Write everything in the one ink at different pressures: text-ink, text-ink-2 and text-ink-3 for quieter text, ink-4 and ink-5 for rules and washes, bg-paper for the page. No palette colours, no hex.
Why: A ballpoint has one colour. The moment a blue-500 or a #6b7280 shows up the page stops being a drawing, and it stops following the look: a hand-picked grey fails contrast on half the papers.
Fix: Swap the colour for a pressure: text-ink-2 for secondary, text-ink-3 for muted, text-pen-red only for destructive or invalid.
### ✗ The pen draws the box
Don't put CSS borders, rounded corners, shadows or rings on Ballpoint components. Their outline, corners and shadow are pen strokes: set them with pen settings (radius, corners, passes, shadow, fill), per component or for a region with InkProvider.
Why: A CSS border is a perfect line next to a wobbling one; it is the clearest tell that a screen wasn't drawn. A rounded-xl clips the stroke and a box-shadow sits under the hatched one.
Fix: Take the class off and use the pen: radius={12} or radius="full" for corners, variant="lifted" or shadow="solid" for a shadow, passes={2} for a heavier line.
### · Draw boxes, don't style them
A plain div with rounded corners and a shadow is a card that wasn't drawn. Reach for Card, Frame or Paper, or a Separator for a rule.
Why: Next to drawn components a CSS box reads as a hole in the page.
Fix: Use Card (a lifted box), Frame (a photo or figure), Paper (a sheet) or Separator (a ruled line).
### ✗ Room for the pen
Never put overflow-hidden on a Ballpoint component. The pen runs a little past every corner and a lifted box casts its shadow outside itself; clip an inner wrapper instead.
Why: Clipped, the corners look open and the shadow is cut square: the drawing looks broken rather than drawn.
Fix: Move overflow-hidden to a div inside the component.
### · One radius
Corners come from one radius for the whole app (0, 6, 12 or full), set once with InkProvider or by the look. Don't give components their own.
Why: A real hand has a habit: it rounds every corner about the same. Mixed radii read as parts from different kits.
Fix: Take radius off the components and set it once on InkProvider. Circles that are the control itself (avatar, radio, switch) are already round.
### · Straight quotes
Write ' and " in copy, not curly quotes. In JSX text, ' and ".
Why: In Gaegu a curly apostrophe is more than twice as wide as a straight one, so "didn’t" opens a gap in the middle of the word.
Fix: Swap ’ ‘ for ' and “ ” for ".
### · A keyboard can scroll it
A region that scrolls on its own (overflow-auto or -scroll) needs tabIndex={0} and a name, or use ScrollArea, which has both.
Why: Without focus, someone on a keyboard can see the region but never read the end of it.
Fix: Add tabIndex={0} and an aria-label, or wrap it in .
### ✗ Drawn icons
Use InkIcon (or the glyphs Ballpoint components already draw), not an icon font or set. They take the ink, the hand and the draw-in.
Why: A lucide icon is a uniform 2px vector line. Beside a pressured pen stroke it is the second tell, right after CSS borders.
Fix: Add @ballpoint/ink-icons and write . The names follow lucide's where they can.
### ✗ The red pen is for mistakes
The red pen (variant="destructive", text-pen-red) means something will be lost or something is wrong. Not emphasis, not a sale, not a call to action.
Why: Everything else is one ink, so red is loud. Spend it on a delete and an error and the reader learns what it means; spend it on Upgrade and they stop trusting it.
Fix: A primary action is the solid default Button. Keep destructive for delete, remove, revoke, discard; text-pen-red for errors.
### · Specials are seasoning
Annotate, Scrawl and MarginNote make a screen's drawn moment. Gather them there, two or three to a screen, rather than sprinkling them everywhere.
Why: One circled word gets read. Ten circled words are a sticker-bombed page and nothing gets read.
Fix: Keep the one that matters most; let the rest be plain text.
### · Let the pen go in reading order
Leave draw on "auto": what comes into view together draws in reading order, each drawing starting as the one before gets going. Content with no drawing of its own takes its turn with useInkStage(). Use draw="mount" for the one thing above the fold that should not wait.
Why: Everything on "mount" draws at once, which looks like a page loading, not a hand writing.
Fix: Drop draw="mount" from all but the first thing seen; spread useInkStage() on lists and copy that should land in turn.
### · Pin seeds on lists
A drawing's wobble comes from its seed, which defaults to where it sits in the tree. Rows that are filtered, paginated or re-sorted are new each time, so pin seed to the row's id and each one keeps its hand.
Why: Without it, the same item redraws differently every time a filter changes, and the page flickers into a new drawing.
Fix: seed={item.id} on the drawn component inside the map.
### ✗ One hand
The page is written in the look's face (Gaegu unless the look says otherwise), with font-mono for code. Regular and font-bold only. No serif, no second display face, never a marker or comic font picked on the side.
Why: The hand is part of the drawing. A second face reads as a different person writing on the same sheet.
Fix: Take the font class off; change the face for the whole page by picking a look.
### ✗ The pen moves, the page doesn't
Motion is the pen drawing in, and it is already there. No animation library, no JS-driven hover; CSS transitions on the ink-* variables if anything.
Why: The strokes already respect reduced motion and draw in reading order. A spring on top fights the hand and breaks both.
Fix: Remove the library. For a lift or a settle, the components already have one; for content landing in turn, useInkStage().
### · Colours come from a look
To change the ink or the paper, pick or make a look (the customizer, or make_look over MCP) and install it. Don't set --ink or --paper by hand.
Why: A look presses the ink only as hard as the paper needs to pass WCAG AA, by day and by night, and moves every pressure with it. A hand-set --ink passes on one paper and fails on the other.
Fix: shadcn add /r/style/.json with a look's code.
## Theming
Everything is one ink at different pressures, mixed toward the paper in oklab so the hue never drifts.
- `--paper`: The page. Cream by day, navy by night.
- `--ink`: The pen. Text, strokes, focus rings.
- `--ink-2, --ink-3`: Lighter pressure for secondary and muted text. Both clear 4.5:1.
- `--ink-line`: Control borders: the lightest pressure that clears 3:1.
- `--ink-4, --ink-5`: Decoration only: rules, washes, hatching.
- `--pen-red`: The only other pen, for destructive and invalid states.
- `--ink-fill`: How solid a pen-shaded fill is under its strokes.
Other pens and papers install the same way, for example `add @ballpoint/pen-black @ballpoint/paper-white`:
- `@ballpoint/pen-blue`: Blue ballpoint. The default: a cheap blue ballpoint, pale blue at night.
- `@ballpoint/pen-black`: Black fineliner. A felt-tip fineliner: nearly black by day, nearly white by night.
- `@ballpoint/pen-pencil`: Pencil. Soft graphite, a little grey and a little shine.
- `@ballpoint/pen-green`: Green ink. A fountain-pen green.
- `@ballpoint/paper-cream`: Cream. The default: warm notebook stock, navy at night.
- `@ballpoint/paper-white`: White. Bright copier paper, near-black at night.
- `@ballpoint/paper-legal`: Legal pad. Yellow legal pad, dark olive at night.
## Looks
Whole styles from the customizer, each one registry item with its colours, ruling, hand and face, passing WCAG AA by day and by night:
- `ballpoint` Ballpoint: The default: a cheap blue biro on cream notebook stock, navy at night. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/ballpoint.json`
- `dot-journal` Dot journal: A black fineliner on dotted ivory. Neat corners, flat fills, a steady hand. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/dot-journal.json`
- `sketchbook` Sketchbook: Soft graphite on heavy white, gone over three times and scribbled in. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/sketchbook.json`
- `blueprint` Blueprint: White lines on cyanotype blue, ruled in a grid. Dark by day, darker by night. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/blueprint.json`
- `chalkboard` Chalkboard: Chalk on a green slate: thick, dusty, and scrawled in a hurry. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/chalkboard.json`
- `legal-pad` Legal pad: Blue-black ink on a ruled yellow pad, dark olive at night. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/legal-pad.json`
- `field-notes` Field notes: Sepia on brown kraft card. Soft corners, shaded in, carried in a back pocket. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/field-notes.json`
- `fountain-pen` Fountain pen: Teal ink on laid ivory: one slow, broad, rounded stroke. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/fountain-pen.json`
- `purple-crayon` Purple crayon: A fat purple crayon on white: pill corners, thick wax, coloured in to the edges. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/purple-crayon.json`
- `gel-pen` Gel pen: Hot pink gel on blush paper, neon on black at night. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/gel-pen.json`
- `typewriter` Typewriter: Ribbon black on onionskin, struck once, square and level. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/typewriter.json`
- `ledger` Ledger: Brown-black ink on a green ruled ledger, kept in hatched columns. `npx shadcn@latest add https://ballpoint.st9wd.com/r/style/ledger.json`
Any other mix: https://ballpoint.st9wd.com/customize, or `make_look` on the MCP server.
## Pen settings
Pass `seed` to pin a component's drawing. How the pen behaves is yours to set per component, or for a whole region with InkProvider; a `salt` there redraws everything inside in a slightly different hand.
```tsx
import { InkProvider } from "@/hooks/use-ink-box"
{children}
```
- `draw`: `"auto" | "mount" | "none"` (default `"auto"`). When the strokes draw themselves in: the first time they scroll into view, as soon as they render, or never (already drawn).
- `roughness`: `number` (default `1`). 0 is ruler-neat, 1 a quick confident hand, 2 a scrawl.
- `passes`: `1 | 2 | 3`. How many times an outline is gone over. Each component picks its own default.
- `radius`: `number | "full"` (default `0`). Corner radius in px; "full" draws a pill.
- `corners`: `"crossed" | "joined"` (default `"crossed"`). Square corners: sides pulled separately past each other, or the box drawn in one motion.
- `fill`: `"shade" | "hatch" | "scribble" | "flat"`. How an area is coloured in. Solid parts default to shade, light ones to hatch.
- `shadow`: `"hatch" | "solid" | "none"` (default `"hatch"`). What a lifted box leaves on the paper. "none" turns the lift off too.
- `weight`: `number` (default `1`). Line weight multiplier. Also settable in CSS as --ink-weight.
- `speed`: `number` (default `1`). Drawing speed multiplier. Also settable in CSS as --ink-speed.
## Button
A pen-drawn box that lifts off a hatched shadow. Solid, outline, secondary, ghost, destructive and link.
Docs: https://ballpoint.st9wd.com/docs/button
```bash
npx shadcn@latest add @ballpoint/button
```
```tsx
import { Button } from "@/components/ui/button"
export function Actions() {
return (
<>
>
)
}
```
Props:
- `variant`: `"default" | "outline" | "secondary" | "ghost" | "destructive" | "link"` (default `"default"`). Shaded solid, boxed, hatched, drawn on hover, red pen, or underlined.
- `size`: `"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg"` (default `"default"`). Height and type size. Icon sizes are square.
- `seed`: `string | number`. Pins the drawing. By default each button gets its own wobble, stable between server and client.
Pen settings: `draw`, `roughness`, `passes`, `radius`, `corners`, `fill`, `shadow`, `weight`, `speed` (see Pen settings).
Every other prop goes to Base UI's Button: https://base-ui.com/react/components/button
## 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.
Docs: https://ballpoint.st9wd.com/docs/input
```bash
npx shadcn@latest add @ballpoint/input
```
```tsx
import { Input } from "@/components/ui/input"
```
Props:
- `variant`: `"box" | "line"` (default `"box"`). 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 .
- `aria-invalid`: `boolean`. Redraws the box in red pen.
- `seed`: `string | number`. Pins the drawing.
Pen settings: `draw`, `roughness`, `passes`, `radius`, `corners`, `weight`, `speed` (see Pen settings).
Every other prop goes to Base UI's Input: https://base-ui.com/react/components/input
## Textarea
A multi-line field in a drawn box that grows with its text, optionally on ruled lines.
Docs: https://ballpoint.st9wd.com/docs/textarea
```bash
npx shadcn@latest add @ballpoint/textarea
```
```tsx
import { Textarea } from "@/components/ui/textarea"
```
Props:
- `variant`: `"box" | "lined"` (default `"box"`). A drawn box, or one with ruled lines to write on.
- `className`: `string`. Styles the drawn box. Every other prop goes to the