No.220 · Authentication
One-Field Sign-in
Email, code, signed in — all inside one field. The field changes width and contents between steps, labels hand off, and a hairline along its base shows how far along you are.
The prompt
The design brief behind this component — reuse it to regenerate, remix, or explain it.
Build a passwordless sign-in where the whole flow happens inside one field. A 68px-tall rounded field (16px radius, surface + hairline ring, accent focus ring) holds three stacked layers; only one is 'on' at a time. Layers cross-fade and slide 14px (out 300ms, in 360ms after a 140ms delay) and each step has its own small mono label in the top-left that lifts away as the next settles in. 1. Email: an email input and a square ink 'go' button; submitting validates, shows a spinner in the button ('sending'), then moves on. 2. Code: the field narrows (width eases over 620ms) and shows six slots (grouped 3+3) under a label 'Code sent to h••••@domain' — a single transparent one-time-code input sits over the slots; typed digits drop in, the caret blinks in the next slot, six digits auto-submit and the slots pulse in sequence while checking. A wrong code shakes the field, turns the progress rule rose and clears the slots. 'Change' goes back. 3. Done: the field narrows again into a full pill containing an initial avatar, the email, and a check that draws in. A 2px hairline along the field's bottom edge is the progress bar (12% → 40% → 62% → 86% → 100%, 760ms), fading out once signed in. Headline and helper text update per step. Ship a night theme and a warm paper theme.
Notes
- Interaction
- Type an email and press Enter/→; type or paste the six-digit code (auto-submits); 'Change' returns to the email step.
- Motion
- 620ms field width/radius morph; layered cross-fade with 140ms hand-off; 760ms progress hairline; digit drop, sequential pulse while checking, shake on error, check draw on success.
- Accessibility
- Real labelled inputs (email with autocomplete=email, code with autocomplete=one-time-code and inputMode numeric); aria-invalid + a polite status line for sending/checking/errors/success; focus moves to the right input each step. Reduced motion keeps the states but makes the transitions instant.
- Responsive
- Fluid up to 26rem; every width is min(100%, …) so it works at 320px.
- On touch
- The numeric keypad opens for the code and SMS/email autofill works through one-time-code.