OTP input
A six digit verification flow with paste support and keyboard navigation.
npx shadcn@latest add @silicon-ui/otp-inputInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/otp-inputManually
Install the dependencies
npm install motionCopy these files into your project
- components/silicon-ui/otp-input/otp-input.tsx
- components/silicon-ui/otp-input/otp-input.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
label* | string | — |
length | number | 6 |
value | string | "" |
onChange | (value: string) => void | — |
description | string | — |
error | string | — |
autoFocus | boolean | false |
disabled | boolean | false |
inputMode | "numeric" | "text" | "numeric" |
className | string | — |
Dependencies
- npm
- motion
- Registry
- silicon-motion-tokens