Centered Card Sign-in
A centred login card with email, a toggleable password field and a submit button.
3 個のフレームワーク初級
A passwordless sign-in that takes only an email and shows a "check your inbox" confirmation.
<!--
Passwordless: one email field, no password. There is no password toggle to
build and no autocomplete="current-password" to get right - the whole point is
that the field is the only credential surface. After submit the caller swaps in
a "check your inbox" confirmation.
-->
<div class="mx-auto w-full max-w-sm rounded-2xl border border-gray-200 bg-white p-6 shadow-sm sm:p-8 dark:border-gray-800 dark:bg-gray-950">
<h1 class="text-xl font-bold tracking-tight text-gray-900 dark:text-gray-100">Sign in with a link</h1>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">No password. We email you a one-time link.</p>
<form class="mt-6 space-y-4" action="#" method="post">
<div>
<label for="magic-email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Email</label>
<input id="magic-email" name="email" type="email" autocomplete="email" required placeholder="you@company.com" class="mt-1.5 w-full rounded-lg border border-gray-300 bg-white px-3.5 py-2.5 text-sm text-gray-900 placeholder:text-gray-500 focus-visible:border-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:placeholder:text-gray-400 dark:focus-visible:ring-blue-400" />
</div>
<button type="submit" class="w-full rounded-lg bg-blue-600 px-5 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-blue-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 focus-visible:ring-offset-white motion-reduce:transition-none dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-950">Email me a link</button>
</form>
<p class="mt-4 text-xs text-gray-500 dark:text-gray-400">By continuing you agree to the terms of service.</p>
</div>| Prop | 型 | デフォルト | 説明 |
|---|---|---|---|
title | string | 'Sign in with a link' | カードの見出しテキスト。 |
submitLabel | string | 'Email me a link' | Submit label |
onSubmit | (email: string) => void | - | 送信時にフォームの値とともに呼ばれます。 |
className | string | - | ルート要素にマージされる追加クラス。 |
There is no password field to secure - the email is the only credential surface. After submit the React and TypeScript variants swap in a confirmation state; nothing is actually emailed, so replace `onSubmit` with your real magic-link request.