‹ components

OTPInput

draftv0.9.0·open in canvas

One-time code cells for wallet connect / verify. Paste fills from any cell; width reserved on first paint. Interior otp-input contract, CSS-only.

Installnpx shadcn add @cids/otpinput
Live demo
Paste the whole code into any cell.Paste the whole code into any cell.

Motion · tap to replay

honors reduced-motion

Border color 150ms. No `motion` package. Reduced-motion: global reset.

Brand chip remounts on tap · highlighted tokens are named in this component's doc · spring is budgeted to human feedback only.

import { OTPInput } from "@/design-system";

<OTPInput
  length={6}
  hint="Paste the whole code into any cell."
  error={rejected}
  errorMessage="That code is wrong."
  onComplete={(code) => verify(code)}
/>

Tokens · live

Resolves in the active theme — flip the toggle above to verify.

States · from doc

Parsed from the doc. Interact with the live demo for hover/active.

emptyfocusedfillederrordisabled

One-time code cells for wallet connect / verify. Paste fills from any cell; width reserved on first paint. Interior otp-input contract, CSS-only.

Anatomy

┌──┐ ┌──┐ ┌──┐   ┌──┐ ┌──┐ ┌──┐
│1 │ │2 │ │3 │ · │4 │ │5 │ │6 │  ← groupEvery gap
└──┘ └──┘ └──┘   └──┘ └──┘ └──┘
hint / error (shared reserved line)

Props

PropTypeDefaultNotes
lengthnumber6Cell count.
mode"numeric" "alphanumeric"`"numeric"Allowed chars + inputMode.
defaultValuestring""Seed, filtered + truncated.
onChange(value: string) => void—Every accepted edit.
onComplete(value: string) => void—When every cell is filled.
errorbooleanfalsearia-invalid on cells.
errorMessage / hintstring—Shared status line (no jump).
labelstring"Verification code"Group + per-cell names.
groupEverynumber3Visual gap every N cells.
disabled / autoFocusbooleanfalse—
classNamestring—cn-merged.

Motion

A11y

Self-contained: copy the folder into any Tailwind+React app, or use the install command above. Docs and this page render the same file on disk — they cannot drift.