Input OTP
A one-time code in separate boxes, where each character rises into its box as it is typed or pasted.
npx shadcn add https://kinoui.com/r/input-otp.jsonCopy install command
Examples
Default
Each digit rises into its box as it is typed, and a whole code can be pasted.
Checked
Check the code in onValueComplete, keep it readOnly while you do, and show a wrong code as the field’s error.
Alphanumeric
For recovery codes, take letters too and normalise them as they arrive.
Installation
Copy code
npx shadcn@latest add https://kinoui.com/r/input-otp.json- Files
lib/refs.tslib/reduce-motion.tscomponents/kino/input.tsxcomponents/kino/separator.tsxcomponents/kino/input-otp.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
InputOTP
CSS variables
Accessibility
- Every box takes the field’s label, and each after the first adds where it is.
- Arrow keys and Backspace move between boxes, and a pasted code fills them all.
- The first box asks the browser to fill a one-time code from a message.
- While a code is checked, keep it
readOnly, notdisabled, so focus stays in it. - When the system asks for less motion, characters only fade in.