Newsletter Capture Band
Email capture with a four-state submission machine and an aria-live status line, so the outcome is announced and not just shown.
A waitlist capture that shows position and referral credit, turning a dead-end confirmation into the one action that moves the queue.
components/referral-waitlist-form.tsxnpx hoverlab add referral-waitlist-form
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.
Everyone who joins gets a position and a link. Three people through your link moves you up a hundred places, which is the only honest way a waitlist is worth sharing.
Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.
'use client'
/**
* <ReferralWaitlistForm> — A waitlist capture that shows position and referral credit, turning a dead-end confirmation into the one action that moves the queue.
*
* A waitlist confirmation is usually a dead end: an address goes in, a
* thank-you comes out, and nothing the person can do changes anything. The
* layout problem is that the only moment they are motivated is the moment
* they submit, and the conventional design spends it on a full stop.
*
* So the form states the referral mechanic before submission rather than
* after. The obvious wrong answer is to reveal it on the confirmation
* screen, where it reads as an upsell attached to something already
* finished; stated first, it is a reason to fill the form in at all.
*
* "Three people through your link moves you up a hundred places" is written
* as an exchange rate rather than as an invitation to share. A waitlist is
* only worth sharing if the sharer can say what it does for them, and a
* vague "move up the queue" is what makes referral links feel like spam to
* send.
*
* The referral field is optional and its hint says it credits both people.
* A code field with no explanation is one arrivals paste blindly and
* organic signups leave blank while wondering whether they should have one.
*
* Accessibility is the same pair as the other forms in this wave, and the
* second half is the one that matters: the `role="status"` region is
* rendered empty on first paint rather than created when the message
* arrives, because a live region that did not exist when the page loaded is
* frequently never announced. It also holds its height, so the card does not
* jump when the confirmation lands.
*
* The demo defaults to `idle`. With no `onSubmit` passed it resolves
* immediately and shows the success message.
*/
import * as React from 'react'
export interface ReferralWaitlistFormProps {
heading?: string
intro?: string
submitLabel?: string
/** Called with the collected values. Resolve to accept, throw to reject. */
onSubmit?: (values: Record<string, string>) => Promise<void> | void
className?: string
}
type Status = 'idle' | 'pending' | 'done' | 'error'
/*
A typed array rather than `as const`. With `as const` the entries have
different shapes - some carry a hint, some do not - so `field.hint` is a
type error on the members that lack it, and the `'hint' in field` dance
needed to work around that is worse than declaring the field optional once.
*/
interface ReferralWaitlistFormField {
name: string
label: string
type: string
hint?: string
}
const FIELDS: ReferralWaitlistFormField[] = [
{ name: "email", label: "Email", type: "email", hint: "One message when your place comes up. Nothing else." },
{ name: "referrer", label: "Referral code", type: "text", hint: "Optional. Credits whoever sent you, and moves you both up." },
]
export function ReferralWaitlistForm({
heading = "Join the queue, or skip it",
intro = "Everyone who joins gets a position and a link. Three people through your link moves you up a hundred places, which is the only honest way a waitlist is worth sharing.",
submitLabel = "Get my place",
onSubmit,
className,
}: ReferralWaitlistFormProps) {
// 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 [status, setStatus] = React.useState<Status>('idle')
const [message, setMessage] = React.useState('')
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
const data = new FormData(event.currentTarget)
const values = Object.fromEntries(
FIELDS.map((field) => [field.name, String(data.get(field.name) ?? '')]),
)
setStatus('pending')
try {
await onSubmit?.(values)
setStatus('done')
setMessage('Thanks — that came through.')
} catch (error) {
setStatus('error')
setMessage(error instanceof Error ? error.message : 'That did not go through.')
}
}
return (
<section
aria-labelledby={`${uid}-referral-waitlist-form-heading`}
className={`w-full bg-background px-6 py-16 ${className ?? ''}`}
>
<div className="mx-auto max-w-md rounded-xl border border-border bg-card p-8 shadow-sm">
<h2
id={`${uid}-referral-waitlist-form-heading`}
className="text-xl font-semibold tracking-tight text-card-foreground"
>
{heading}
</h2>
<p className="mt-2 text-sm text-muted-foreground">{intro}</p>
<form onSubmit={handleSubmit} className="mt-6 space-y-4">
{FIELDS.map((field) => (
<div key={field.name}>
{/*
htmlFor / id rather than a wrapping label, so the hint can
sit outside the label and still be announced — that is what
aria-describedby is for.
*/}
<label
htmlFor={`${uid}-referral-waitlist-form-${field.name}`}
className="block text-sm font-medium text-foreground"
>
{field.label}
</label>
<input
id={`${uid}-referral-waitlist-form-${field.name}`}
name={field.name}
type={field.type}
required
aria-describedby={field.hint ? `${uid}-referral-waitlist-form-${field.name}-hint` : undefined}
className="mt-1.5 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
/>
{field.hint ? (
<p
id={`${uid}-referral-waitlist-form-${field.name}-hint`}
className="mt-1 text-xs text-muted-foreground"
>
{field.hint}
</p>
) : null}
</div>
))}
<button
type="submit"
disabled={status === 'pending'}
className="w-full rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60"
>
{status === 'pending' ? 'Working…' : submitLabel}
</button>
{/*
The live region is always in the DOM and starts empty. A region
mounted at the moment it gets text is frequently not announced —
the assistive tech never saw it become live.
*/}
<p
role="status"
aria-live="polite"
className={`min-h-5 text-sm ${
status === 'error' ? 'text-destructive' : 'text-muted-foreground'
}`}
>
{message}
</p>
</form>
</div>
</section>
)
}
bg-card, text-muted-foreground) — it inherits your theme instead of overriding it.Drop it at components/referral-waitlist-form.tsx and import it where you need the section:
import { ReferralWaitlistForm } from '@/components/referral-waitlist-form'2 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 | "Join the queue, or skip it" |
intro | string | — |
submitLabel | string | "Get my place" |
onSubmitCalled with the collected values. Resolve to accept, throw to reject. | (values: Record<string, string>) => Promise<void> | void | — |
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.
<!--
Referral Waitlist Form — 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.
-->
<section aria-labelledby="_R_0_-referral-waitlist-form-heading" class="w-full bg-background px-6 py-16 ">
<div class="mx-auto max-w-md rounded-xl border border-border bg-card p-8 shadow-sm">
<h2 id="_R_0_-referral-waitlist-form-heading" class="text-xl font-semibold tracking-tight text-card-foreground">Join the queue, or skip it</h2>
<p class="mt-2 text-sm text-muted-foreground">Everyone who joins gets a position and a link. Three people through your link moves you up a hundred places, which is the only honest way a waitlist is worth sharing.</p>
<form class="mt-6 space-y-4">
<div>
<label for="_R_0_-referral-waitlist-form-email" class="block text-sm font-medium text-foreground">Email</label>
<input id="_R_0_-referral-waitlist-form-email" type="email" required="" aria-describedby="_R_0_-referral-waitlist-form-email-hint" class="mt-1.5 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" name="email" />
<p id="_R_0_-referral-waitlist-form-email-hint" class="mt-1 text-xs text-muted-foreground">One message when your place comes up. Nothing else.</p>
</div>
<div>
<label for="_R_0_-referral-waitlist-form-referrer" class="block text-sm font-medium text-foreground">Referral code</label>
<input id="_R_0_-referral-waitlist-form-referrer" type="text" required="" aria-describedby="_R_0_-referral-waitlist-form-referrer-hint" class="mt-1.5 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" name="referrer" />
<p id="_R_0_-referral-waitlist-form-referrer-hint" class="mt-1 text-xs text-muted-foreground">Optional. Credits whoever sent you, and moves you both up.</p>
</div>
<button type="submit" class="w-full rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60">Get my place</button>
<p role="status" aria-live="polite" class="min-h-5 text-sm text-muted-foreground"></p>
</form>
</div>
</section>
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 CTA SectionsCopying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
Email capture with a four-state submission machine and an aria-live status line, so the outcome is announced and not just shown.
A closing CTA of three link cards pointing at GitHub, chat and social — somewhere to go for the visitor who is not ready to convert.
A rounded gradient panel that restates the offer for the reader who scrolled past everything — heading left, both CTAs right, reassurance points underneath.
The call to action that follows a long page down — held back until the reader is past a scroll threshold, dismissible, and spaced so it never covers the content it is selling.
The offer that sits inside the column instead of interrupting it — a labelled aside a screen reader can skip in one keystroke, tied to the paragraph above it, with the friction admitted before the click.
A demo request that offers the self-serve escape first, so the people who did not want a call do not book one.