Passwordless email entry that sends a single-use sign-in link.
We'll email you a link for password-free sign-in.
Prefer a password? Sign in
Install with the CLI, or add the packages and paste the source below.
Add Magic Link to your app with its source-owned dependencies.
npx cronus-ui add magic-link
Install the Cronus UI packages, then paste the block below.
Copy the source for Request link. Every class is a semantic token, so it re-themes with your app.
import {Button,Card,CardContent,CardFooter,CardHeader,CardTitle,Input,Label,Separator,} from "@cronus-ui/ui";import { Sparkles } from "lucide-react";function GithubGlyph(props: React.SVGProps<SVGSVGElement>) {return (<svgxmlns="http://www.w3.org/2000/svg"width="24"height="24"viewBox="0 0 24 24"fill="none"stroke="currentColor"strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"aria-hidden="true"{...props}><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4" /><path d="M9 18c-4.51 2-5-2-7-2" /></svg>);}function ChromeGlyph(props: React.SVGProps<SVGSVGElement>) {return (<svgxmlns="http://www.w3.org/2000/svg"width="24"height="24"viewBox="0 0 24 24"fill="none"stroke="currentColor"strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"aria-hidden="true"{...props}><path d="M10.88 21.94 15.46 14" /><path d="M21.17 8H12" /><path d="M3.95 6.06 8.54 14" /><circle cx="12" cy="12" r="10" /><circle cx="12" cy="12" r="4" /></svg>);}export function MagicLinkBlock() {return (<div className="flex w-full items-center justify-center py-4"><Card className="w-full max-w-sm gap-6 shadow-lg"><CardHeader className="flex flex-col items-center gap-3 text-center"><span className="inline-flex size-11 items-center justify-center rounded-xl bg-gradient-primary text-primary-foreground shadow-glow"><Sparkles className="size-5" aria-hidden="true" /></span><div className="flex flex-col gap-1"><CardTitle className="font-display text-xl">Sign in with a magic link</CardTitle><p className="text-sm text-fg-secondary">We'll email you a link for password-free sign-in.</p></div></CardHeader><CardContent className="flex flex-col gap-4"><div className="flex flex-col gap-2"><Label htmlFor="magic-email">Email</Label><Input id="magic-email" type="email" placeholder="you@company.com" autoComplete="email" /></div><Button variant="primary" size="lg" className="w-full">Send magic link</Button><div className="flex items-center gap-3"><Separator className="flex-1" /><span className="text-xs text-fg-tertiary">or continue with</span><Separator className="flex-1" /></div><div className="grid grid-cols-2 gap-3"><Button variant="outline"><GithubGlyph className="size-4" aria-hidden="true" />GitHub</Button><Button variant="outline"><ChromeGlyph className="size-4" aria-hidden="true" /></Button></div></CardContent><CardFooter className="justify-center"><p className="text-sm text-fg-secondary">Prefer a password?{" "}<ahref="/login"className="font-medium text-primary-strong underline-offset-4 hover:underline">Sign in</a></p></CardFooter></Card></div>);}
We'll email you a link for password-free sign-in.
Prefer a password? Sign in