Morphing Login / Sign Up

Morphing Login / Sign Up

One auth card that morphs between Log in and Sign up: a sliding segmented header, Name and Confirm fields that grow in and out, and a title and button that morph glyph by glyph. Invalid submits shake the card and highlight the field with an error haptic, while valid ones squeeze the button into a spinner and land on a checkmark.

Luiz Mello
  • auth
  • form
  • animation

snippet.swift475 lines

10 files • Scroll to see all →
//// One auth card that morphs between Log in and Sign up.//// - A segmented header slides its pill between the two modes.// - Name and Confirm password fields grow in and out, while the title,//   subtitle and button text morph glyph by glyph (`contentTransition`).// - An invalid submit shakes the whole card, outlines the offending field,//   shows an inline hint and plays an error haptic.// - A valid submit squeezes the button capsule into a circle, spins, then//   lands on a checkmark with a success haptic.//// State lives in an `@Observable` model so a host (or a demo script) can// switch modes, fill fields and submit programmatically.
Viewing: MorphingLoginSignUp.swift•1 of 10