Centered Sign-up Card
A centred registration card with name, email and password fields and a full-width submit.
3 frameworksBeginner
A registration card with a required terms-and-privacy consent checkbox linked to its label.
<!--
The consent checkbox is required and wired to its label via for/id, so the
whole sentence (including the two links) is the clickable target. The links
open policy pages, so the label wraps <a> elements rather than swallowing them.
-->
<form 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" action="#" method="post">
<h1 class="text-xl font-bold tracking-tight text-gray-900 dark:text-gray-100">Create your account</h1>
<div class="mt-6 space-y-4">
<div>
<label for="stc-email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Email address</label>
<input id="stc-email" name="email" type="email" autocomplete="email" required placeholder="you@company.com"
class="mt-1.5 block w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:placeholder:text-gray-500 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-950" />
</div>
<div>
<label for="stc-password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Password</label>
<input id="stc-password" name="password" type="password" autocomplete="new-password" required placeholder="At least 8 characters"
class="mt-1.5 block w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:placeholder:text-gray-500 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-950" />
</div>
</div>
<div class="mt-5 flex items-start gap-3">
<input id="stc-consent" name="consent" type="checkbox" required
class="mt-0.5 h-4 w-4 shrink-0 rounded border-gray-300 text-blue-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:border-gray-600 dark:bg-gray-900 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-950" />
<label for="stc-consent" class="text-sm leading-relaxed text-gray-600 dark:text-gray-400">
I agree to the
<a href="#" class="font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400">Terms of Service</a>
and
<a href="#" class="font-medium text-blue-600 hover:text-blue-500 dark:text-blue-400">Privacy Policy</a>.
</label>
</div>
<button type="submit"
class="mt-6 inline-flex w-full items-center justify-center rounded-lg bg-blue-600 px-4 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">
Create account
</button>
</form>| Prop | Type | Default | Description |
|---|---|---|---|
title | string | 'Create your account' | Heading text for the card. |
termsHref | string | '#' | Terms href |
privacyHref | string | '#' | Privacy href |
submitLabel | string | 'Create account' | Submit label |
onSubmit | (event: FormEvent<HTMLFormElement>) => void | - | Called with the form's values when it is submitted. |
The checkbox is `required` and tied to its label via `for`/`id`, so the whole sentence - including the two policy links - is the clickable target. Point `termsHref` and `privacyHref` at your pages. It is display-only: nothing is submitted until you wire `onSubmit`.