https://github.com/driaug/otp
Minimalistic one-time password component for React, built with Tailwind and Typescript.
https://github.com/driaug/otp
react tailwind typescript
Last synced: over 1 year ago
JSON representation
Minimalistic one-time password component for React, built with Tailwind and Typescript.
- Host: GitHub
- URL: https://github.com/driaug/otp
- Owner: driaug
- License: unlicense
- Created: 2023-08-08T17:10:33.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-06T12:42:44.000Z (about 2 years ago)
- Last Synced: 2025-03-17T05:44:28.687Z (over 1 year ago)
- Topics: react, tailwind, typescript
- Homepage: https://otp.driaug.com
- Size: 96.7 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# OTP Component
A minimalistic one-time password component for React, built with Tailwind and Typescript.
Includes support for various OTP needs such as:
- 🗑️ Backspace & delete
- 🖨️ Copy & Paste
- ⇥ Accessibility with tab

## Basic Usage
- Copy the [component](./demo/src/components/OTP.tsx) to your own project
```tsx
console.log(otp)} />
```
## Parameters
| Parameter | Type | Use |
|------------|------------------|-----------------------------------------------------------|
| onComplete | `(otp) => void;` | Function that will trigger once the password is filled in |
| length | `number` | Number of boxes, defaults to `6` |
| disabled | `boolean` | Disables the input, defaults to `false` |