Readback

Groups a licence key, IBAN or Wi-Fi password and labels every look-alike character, so 0 and O or 1 and l aren't misread.

StopsLicence key misread, 0 vs O

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/readback.json

The files land in your project. They're yours to edit.

Usage

readback-usage.tsx
import { Readback } from "@/components/ui/readback"

<Readback label="License key" value="8OB1-lZ5S-Q0I2-7KXM" />

What it catches

  • Zero vs letter O, one vs small L, and other look-alikes
  • Long values without grouping
  • Copying spaces or dashes: copies the clean value
  • Reading it across a room: large view

Props

Readback props
PropTypeDefault
value* (required)

The value to read or type elsewhere. Spaces and dashes are removed before grouping.

string—
label* (required)

What it is, e.g. "Wi-Fi password".

string—
groupSize

Characters per group, or a pattern like [4, 4, 4, 4].

number | number[]4
verbatim

Keep the original separators instead of stripping them (for passwords where they matter).

booleanfalse
showMode

Offer a full-screen, large-type view for showing the value to someone.

booleantrue
copyLabel

Text of the copy button.

string"Copy"
copiedLabel

Text shown after copying.

string"Copied"
showLabel

Text of the full-screen button.

string"Show"
doneLabel

Text of the button that closes the full-screen view.

string"Done"

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Screen readers get the value spelled out group by group ("letter O", "small L"); the visual groups are aria-hidden
  • Large view is a labelled dialog opened by a button with aria-haspopup
  • Copy result is announced in a polite live region

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

  • Display only; it doesn't validate the value
  • Look-alike list is fixed and Latin-only

What it stops

Licence key misread, 0 vs O

Also known as

license key · product key · wifi password · iban · recovery code · readback · monospace · confusable characters

Dependencies

Pairs well with