Skip to content
Ballpoint

Redact

Words scribbled out with the pen, shown when clicked and scribbled over again on the next.

Only in Ballpoint

The launch is on , and the code name is . Click to read them.

Installation

pnpm dlx shadcn@latest add @ballpoint/redact

Usage

tsx
import { Redact } from "@/components/ui/redact"

<p>The code name is <Redact>Blue Biro</Redact>.</p>

Examples

Reveal them all

Control revealed and the scribbles come off together; clicking one still reports through onRevealedChange.

Codename
Launch
Budget

In a letter

Names, places and sums scribbled over; click each to read it, and again to cover it.

Dear ,

We write about the project at . The budget stands at and the first test is set for .

Please tell no one. Click a bar to read it, and again to cover it.

Secrets in a table

Keys that stay hidden until asked for, each with its own screen-reader label.

KeySecretStatus
ProductionActive
StagingActive
Old laptopRevoked

API reference

label
default "Hidden text"
string

What screen readers hear while it's hidden; they don't get the words until it's shown.

revealed / defaultRevealed
default false
boolean

Shown or scribbled over, controlled or not.

onRevealedChange
(revealed: boolean) => void

Called as it's clicked.

seed
string | number

Pins the scribble.

Pen settings

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