Node.js 16+ npm or yarn
You can customize the component by modifying the tokens.ts object inside the tokens.ts component :
src/ ├── components/ │ ├── TwoFactor.svelte # Main component │ ├── LockStatus.svelte # Lock icon with animations │ ├── OtpBox.svelte # Individual digit input box │ └── ProgressButton.svelte # Animated submit button ├── lib/ │ ├── useOtp.ts # OTP management store │ ├── utils.ts # Utility functions │ └── types.ts # TypeScript definitions └── tokens.ts # Configuration tokens
Enter digits → boxes auto-advance Backspace/Arrow keys → move focus Correct code → “Let’s go!” button with liquid filling animation from right to left Wrong code → “Wrong code!” with digit boxes and button shake