Base Components
Digit Input
A component for entering one-time passwords (OTPs) in a digit-by-digit manner. Ideal for secure authentication flows where users need to input short numeric codes.
Installation
Install the following dependencies:
terminal
Create a digit-input.tsx
file and paste the following code into it.
/components/ui/digit-input.tsx
Update the import paths to match your project setup.
Examples
Has Error
Disabled
Square Inputs
API Reference
DigitInput.Root
This component is based on the react-otp-input package. Refer to their documentation for the API reference.
Prop | Type | Default |
---|---|---|
hasError | boolean | |
disabled | boolean |
© 2024 AlignUI Design System. All rights reserved.