This is a production-ready Two-Factor Authentication (2FA) component built using Svelte. It includes OTP input fields and provides real-time validation for user input. The component supports success and error states, resets dynamically when inputs are changed, and ensures input security by accepting only numeric values.
Backspace navigation and supports Enter key submission.├── src
│ ├── App.svelte # Main entry component
│ ├── components
│ │ └── OTPInput.svelte # Reusable OTP Input component
│ ├── services
│ │ └── otpService.js # Service for OTP validation logic
│ ├── stores
│ │ └── otpStore.js # Svelte stores for managing state
| View | SS |
|---|---|
| Empty | |
| Filled | |
| Success | |
| Error |