Matrix code (Pro)
ProIncluded in $99A one time code on dot matrix panels that pours into a check.
On this page
Each digit lights up on its panel in a quick top down scan, and the caret is the panel's bottom row of dots, blinking with a small wipe. Get the code right and every lit dot leaves its panel on a lifted arc and pours into one big dotted check, a light runs along it, and it settles small beside Verified. Get it wrong and the dots burst out, spring back in red and clear. A real input sits underneath, so typing, pasting and one time code autofill all work.
Installation
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
import { MatrixCode } from "@/components/ui/chatcn/pro/matrix-code"
<MatrixCode verify={(code) => api.checkCode(code)} hint="Didn't get a code? Resend" />verify can return a promise. Clear value after Verified to play the dots back home.
Props
| Prop | Type | Notes |
|---|---|---|
verify | (code: string) => boolean | Promise<boolean> | Runs once every digit is in |
length | number | Default 6, split in half |
value / onValueChange | string | Optional control |
hint | ReactNode | Under the panels |
invalidMessage / verifiedLabel | ReactNode |
Keyboard
| Key | Action |
|---|---|
0 to 9, paste | Fill the code |
Backspace | Clear a digit |
Escape | Start again after Verified |
Accessibility
- One real input with
autocomplete=one-time-code; the wrong code message and Verified are announced as a status.
Motion
- Digits scan in 110 ms; the dots fly 640 ms on a small spring and settle in 620 ms. Reduced motion: the check appears without the flight.