Report a problem or share feedback← Catalog
Clerk: Conditional Field
freemotion/clerk-conditional-field
A password field that animates into a sign-in form only when it's needed. The container animates its measured height with Motion's resize() util while the field fades in.
$
pnpm add motion # then adapt the free source from https://motion.dev/examples/react-clerk-conditional-fieldnpm deps: motion

- Source
- Motion (motion.dev)
- Kind
- transition
- Categories
- transition, input, form
- Use as
- recipe — technique you apply to your own markup
- Applies to
- forminput
- Motion
- on enter · medium · motion · medium cost
- Tags
- motion, AnimatePresence, MotionConfig, animate
- Licence
- motion / motion/react / motion-v are MIT. Motion+ (premium components, example source, AI Kit pro tools) is paid — one-time Personal licence or per-seat Business.
- Live demo
- motion.dev
- Docs
- motion.dev
Similar
Compare all 4 →- Checkbox checktransitions/checkbox-checkCheckboxes, to-do completion, multi-select rows — any boolean control where the checked state should feel earned. The box's background fills first, then the checkmark draws itself via stroke-dashoffset after a short delay; unchecking reverses quickly with no draw.
- Toggletransitions/toggleOn/off switches — settings rows, theme toggles, feature flags. The thumb travels across the track with a two-step overshoot (past the end, back, settle) while the track color cross-fades on its own clock.
- Error state shaketransitions/error-state-shakeForm validation feedback — invalid email, wrong password, missing required field, mismatched confirmation. The input shakes left/right with overshoot, the border switches to error color, and a message reveals beneath. After a hold timer (long enough to read the message), border + message fade back to neutral. Optional: typing into the input cancels the auto-revert immediately.