Component packs › Latch › Magic Link

Magic Link

Press send and a letter rises out of the button, folds into an envelope, seals and slides back into a slot; then the resend timer runs round the button’s edge.

Magic Link is a passwordless sign-in from Latch, a component pack with 8 components: Form and sign-in components that work like little mechanisms. Price: $2 for the whole pack.

Built with: folding letter, edge timer, email check.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Magic Link props

PropTypeDefaultDescription
titlestring
hintstringLine under the title.
send(email: string) => Promise<void>waits 0.6 sSend the link. Resolve when sent, reject to show an error. Default: waits 0.6 s.
resendAfternumber30Seconds before the link can be sent again. Default 30.
theme'dark' | 'light'
autoplaybooleanShowcase mode: types an address and sends, again and again, until touched.

Methods on the ref

Use it in React

import MagicLink from './MagicLink';

<MagicLink />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Latch

Good for: Form and sign-in components.