Set New Password
A new-password and confirm-password pair with a show toggle and a live mismatch hint.
3 frameworksBeginner
Step one of a reset: an email field and a submit that mails a recovery link.
<!--
Step one of a reset: collect the email, mail a link. type="email" earns the
right mobile keyboard and free validation; autocomplete="email" lets the
browser fill it. The card is w-full max-w-sm so it fills a phone and settles at
a readable width on desktop.
-->
<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">Forgot your password?</h1>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">Enter your email and we'll send a reset link.</p>
<form class="mt-6 space-y-4" action="#" method="post">
<div>
<label for="rp-email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Email</label>
<input
id="rp-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">
Send reset link
</button>
</form>
<p class="mt-6 text-center text-sm text-gray-600 dark:text-gray-400">
<a href="#" class="font-medium text-blue-600 hover:text-blue-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 dark:text-blue-400 dark:focus-visible:ring-blue-400">Back to sign in</a>
</p>
</div>| Prop | Type | Default | Description |
|---|---|---|---|
title | string | 'Forgot your password?' | Heading text for the card. |
subtitle | string | - | Subtitle |
submitLabel | string | 'Send reset link' | Submit label |
onSubmit | (data: { email: string }) => void | - | Called with the form's values when it is submitted. |
className | string | - | Additional classes merged onto the root element. |
The field is a real `<label>` plus `type="email"` and `autocomplete="email"`, so mobile gets the right keyboard and the browser can fill it. `onSubmit` is a no-op by default - wire it to your own backend; this component never posts anywhere.