Morphing Verification Code Input
The Enter code pill squeezes and pops open into six digit boxes with a spring-following focus ring. A wrong code shakes the row and drops digits out one by one; a correct one fades to a green Verified state. Real keyboard input works.
// Sign in to see the source. Free pieces need a free account.
Agent prompt
Add the Now In Code component "morphing-verification-code-input" to this project. The full source is attached at the end of this prompt. Put the files under components/morphing-verification-code-input/, install the listed dependencies with `npx expo install`, and render it on a route I can open. Keep the timing and easing values documented in the source comments. Replace the sample copy and artwork with content from my app, or leave placeholders and list what I still need to supply. === Sign in to attach the source files ===
Details
- Platforms
- iOS, Android, Web
- Requires
- Expo SDK 54+
- Access
- Free
- Updated
- 7 Oct 2026
- License
- Unlimited commercial projects
- Original design
- @sucodeee on X
Are you the designer? Ask us to change or remove this.
Add pieces from the terminal or let your agent fetch them. Until then, Copy prompt does the same job. Docs
What it does
A one-time-code field that changes shape through its states. It starts as a small pill labelled Enter code. Tapping it grows a row of six cells with a ring on the active slot and a blinking caret. Each digit enters with a short rise and a blur-to-sharp transition. After the sixth digit the row squeezes into a Verifying pill with a spinner. A wrong code shakes the pill sideways, turns it pink, drops the digits out from right to left and puts the ring back on the first cell. A correct code turns the pill green and swaps the text for a check and Verified. A hidden input handles typing, paste and autofill, and the demo loop and an interactive mode both exist.
How it's built
A pure JavaScript function takes an event log and a time and returns the state of every cell, the ring, the caret and the pill width, so the web preview and the React Native component read the same numbers. The native version renders with react-native-svg and uses expo-blur for whole-layer blur. React Native has no CSS filter, so text blur is faked with a ghost Text and a shadow radius. Width changes squeeze first and then spring open, and the ring follows the final slot with a short spring. A requestAnimationFrame loop drives the clock.
Good for
- Email or SMS verification screens
- Two-factor and PIN entry where success and failure need clear feedback
- Any control that should reshape itself as it moves between idle, input, loading and result
Dependencies
react-native-svgexpo-blurreact-native