KQ-023 · CODE/CELLS

Code Cells

Six digits, dropped into place — one hidden one-time-code input drives visual cells with digit drops, underline ticks, and a rejection nudge.

KQ-023 · CODE/CELLS

Pair field unit

Demo code · 314159

Install

One command — the source lands in your repo. Or copy it from the Code tab.

$ pnpm dlx shadcn@latest add @kinetiq/code-cells

Props

PropTypeDefaultDescription
lengthnumber6Cell count; also the hidden input's maxLength.
value / defaultValue / onValueChangestring / string / (code) => voidControlled or uncontrolled code, digits only.
onComplete(code: string) => voidFires once per fill; re-arms when the code shrinks.
error / errorMessageboolean / stringDestructive borders plus a row nudge and a role=alert line.
groupsnumber[]e.g. [3,3] renders a separator between digit groups.
refRef<HTMLInputElement>Reaches the hidden input — focus() after clearing.