Email & Social Login Card
Centred sign-in card with social providers, a password reveal toggle and the autoComplete values password managers actually need.
Reset-link request with a sent state worded to avoid leaking whether an account exists.
components/auth-forgot-password.tsxnpx hoverlab add auth-forgot-password
Or over MCP, from your editor's agent — no account needed.
Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.
Start a page with this section — add more, order them, and leave with the page source.
Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.
'use client'
/**
* <AuthForgotPassword> — request a reset link.
*
* The success state confirms that a link was sent *if the account exists*,
* and says so in those words. Confirming outright that mail went to an
* address turns this form into an account-enumeration oracle, and it is
* the one place where the honest-sounding message is the insecure one.
*
* The whole card swaps to the sent state rather than showing a banner above
* the form — leaving the field in place invites a second submit, and a
* resend is a different action with its own cooldown.
*/
import * as React from 'react'
import { ArrowLeft, Loader2, MailCheck } from 'lucide-react'
export interface AuthForgotPasswordProps {
heading?: string
subheading?: string
onSubmit?: (email: string) => Promise<void>
loginHref?: string
/**
* Render as a demo inside a larger page, which drops the email field's
* `autoFocus`. Focusing an input scrolls the browser to it, so a card in
* a preview grid would drag the visitor down the page on load.
*/
embedded?: boolean
className?: string
}
export function AuthForgotPassword({
heading = 'Reset your password',
subheading = 'Enter your email and we will send you a link to set a new one.',
onSubmit,
loginHref = '/login',
embedded = false,
className = '',
}: AuthForgotPasswordProps) {
// Per-instance ids. A literal id in a reusable component is a
// collision waiting for the second copy on the page — and a <label>
// then resolves to whichever input rendered first.
const uid = React.useId()
const [email, setEmail] = React.useState('')
const [busy, setBusy] = React.useState(false)
const [sent, setSent] = React.useState(false)
async function handleSubmit(event: React.FormEvent) {
event.preventDefault()
if (busy) return
setBusy(true)
try {
await onSubmit?.(email)
setSent(true)
} catch {
// Same outcome either way — see the note above.
setSent(true)
} finally {
setBusy(false)
}
}
return (
<div className={`flex min-h-96 w-full items-center justify-center p-6 ${className}`}>
<div className="w-full max-w-sm rounded-2xl border border-border/60 bg-card/80 p-7 shadow-sm backdrop-blur">
{sent ? (
<div className="text-center">
<div className="mx-auto mb-4 inline-flex h-11 w-11 items-center justify-center rounded-xl bg-emerald-500/15 text-emerald-600 dark:text-emerald-400">
<MailCheck className="h-5 w-5" />
</div>
<h1 className="text-2xl font-bold tracking-tight">Check your inbox</h1>
<p className="mt-2 text-sm text-muted-foreground">
If an account exists for{' '}
<span className="font-medium text-foreground">{email}</span>, a reset
link is on its way. It expires in 30 minutes.
</p>
<button
type="button"
onClick={() => setSent(false)}
className="mt-6 text-sm font-semibold hover:underline"
>
Use a different address
</button>
</div>
) : (
<>
<h1 className="text-2xl font-bold tracking-tight">{heading}</h1>
<p className="mt-1.5 text-sm text-muted-foreground">{subheading}</p>
<form onSubmit={handleSubmit} className="mt-6 space-y-4">
<div>
<label htmlFor={`${uid}-forgot-email`} className="mb-1.5 block text-sm font-medium">
Email
</label>
<input
id={`${uid}-forgot-email`}
type="email"
required
autoFocus={!embedded}
autoComplete="username"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="you@company.com"
className="w-full rounded-xl border border-border/60 bg-background px-3.5 py-2.5 text-sm outline-none transition-shadow placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-primary"
/>
</div>
<button
type="submit"
disabled={busy}
className="inline-flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-60"
>
{busy ? <Loader2 aria-hidden className="h-4 w-4 animate-spin motion-reduce:[animation-duration:1.6s]" /> : null}
{busy ? 'Sending' : 'Send reset link'}
</button>
</form>
</>
)}
<a
href={loginHref}
className="mt-6 inline-flex w-full items-center justify-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground"
>
<ArrowLeft aria-hidden className="h-4 w-4 rtl:rotate-180" />
Back to sign in
</a>
</div>
</div>
)
}
bg-card, text-muted-foreground) — it inherits your theme instead of overriding it.Drop it at components/auth-forgot-password.tsx and import it where you need the section:
import { AuthForgotPassword } from '@/components/auth-forgot-password'4 of this block’s props are simple enough to drive from here. Change them and the block below re-renders — it is the same component whose source is above, not a mock of it. Everything else it accepts is in the table underneath.
Read out of the component’s own type and signature, so this cannot drift from the source below. Every prop has a default — the component renders standalone before you pass it anything.
| Prop | Type | Default |
|---|---|---|
heading | string | 'Reset your password' |
subheading | string | 'Enter your email and we will send you a link… |
onSubmit | (email: string) => Promise<void> | — |
loginHref | string | '/login' |
embeddedRender as a demo inside a larger page, which drops the email field's `autoFocus`. Focusing an input scrolls the browser to it, so a card in a preview grid would drag the visitor down the page on load. | boolean | false |
className | string | '' |
The same block rendered once to markup, wrapped as a file your framework compiles. Tailwind classes are framework-agnostic, so the design transfers intact — the behaviour does not.
This block is interactive. The markup below is its initial state with the event handlers stripped — you will need to re-wire the behaviour in your framework.
<!--
Password Reset Request — markup from the Hoverlab catalog.
This is the block rendered once to HTML and wrapped as a component
file. It is not a port of the React source: the Tailwind classes carry
the design, which is the part that took the work, and they are the same
in every framework.
This block is interactive in React and the handlers are NOT here.
Buttons, toggles and menus render in their initial state and do
nothing until you wire them up.
-->
<div class="flex min-h-96 w-full items-center justify-center p-6 ">
<div class="w-full max-w-sm rounded-2xl border border-border/60 bg-card/80 p-7 shadow-sm backdrop-blur">
<h1 class="text-2xl font-bold tracking-tight">Reset your password</h1>
<p class="mt-1.5 text-sm text-muted-foreground">Enter your email and we will send you a link to set a new one.</p>
<form class="mt-6 space-y-4">
<div>
<label for="_R_0_-forgot-email" class="mb-1.5 block text-sm font-medium">Email</label>
<input id="_R_0_-forgot-email" type="email" required="" autofocus="" autoComplete="username" placeholder="you@company.com" class="w-full rounded-xl border border-border/60 bg-background px-3.5 py-2.5 text-sm outline-none transition-shadow placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-primary" value="" />
</div>
<button type="submit" class="inline-flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-60">Send reset link</button>
</form>
<a href="/login" class="mt-6 inline-flex w-full items-center justify-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-left h-4 w-4 rtl:rotate-180" aria-hidden="true"><path d="m12 19-7-7 7-7"></path><path d="M19 12H5"></path></svg>Back to sign in</a>
</div>
</div>
What each framework gets across the whole catalog — effects convert properly; this rung is markup.
The component, its props, the design tokens it expects and the command that installs it — as one prompt. Paste it into Claude, Cursor, v0 or ChatGPT and what they build around it will match the rest of the catalog instead of inventing its own system.
Want the whole screen instead of this one section? Open a page and copy it entire.
All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.
Browse AuthenticationCopying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
Centred sign-in card with social providers, a password reveal toggle and the autoComplete values password managers actually need.
Registration form beside a testimonial panel, with live password rules and a proof column that drops rather than stacks on mobile.
Six-box OTP entry that handles paste, backspace, arrow keys and iOS SMS autofill — the parts hand-rolled versions always miss.
Set-a-new-password form with a four-step strength meter, confirm matching and errors announced rather than only coloured.
Authenticator-code prompt with a backup-code escape hatch and an opt-in trusted-device checkbox that is off by default.
Email first, then whatever that domain uses. The password field is absent rather than disabled when SSO is enforced, the button names the company it redirects to, and a personal address is a normal answer instead of an error.
Passwordless sign-in that says what will land in the inbox and how long it lasts, before the address is typed.
What SSO actually covers, written for the person who has to configure it rather than the person who asked for it.