Split Contact Form
A contact form beside the channels that bypass it — a real address, a support link and a response-time promise, which is what makes a form people cannot see into feel worth filling.
A qualifying contact form that asks the three things a first reply needs, and says what happens next before you send it.
components/contact-sales-form.tsxnpx hoverlab add contact-sales-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.
Three fields, because a fourteen-field form is a way of asking for the meeting twice. You get a reply inside one working day.
Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.
'use client'
/**
* <ContactSalesForm> — A qualifying contact form that asks the three things a first reply needs, and says what happens next before you send it.
*
* The layout problem with a contact form is that every field costs replies
* and the pressure is always to add one more. The obvious wrong answer is
* the fourteen-field qualification form, which is a way of asking for the
* meeting twice: once by the form and once by the reply that has to ask what
* the form did not.
*
* Three fields, and each one earns its place by changing what happens next
* — the address the reply goes to, enough to look the company up before the
* call, and one line that decides who replies. A "company size" dropdown
* would change nothing about the first reply, so it is not here.
*
* Two accessibility decisions, and the second is the one usually missed.
* Labels are associated with `htmlFor`/`id` rather than by wrapping the
* input, which lets the hint sit outside the label and still be announced
* through `aria-describedby` — a wrapped label would either swallow the hint
* into the label text or lose it entirely.
*
* The second: the live region is always in the DOM and starts empty. A
* <p role="status"> that is mounted at the moment it receives text is
* frequently not announced at all, because the assistive technology never
* observed it becoming live. Rendering it empty from the first paint and
* writing into it later is what makes the success and error messages
* audible, and it is why the element has a `min-h-5` — an empty region that
* takes no space makes the form jump when it fills.
*
* The demo defaults to `idle` with an empty message, which is the state
* every reader arrives in. `onSubmit` is optional and unset here, so the
* demo resolves immediately and shows the success state — throw from it to
* see the error path.
*/
import * as React from 'react'
export interface ContactSalesFormProps {
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 ContactSalesFormField {
name: string
label: string
type: string
hint?: string
}
const FIELDS: ContactSalesFormField[] = [
{ name: "email", label: "Work email", type: "email", hint: "We reply here. It is never added to a list." },
{ name: "company", label: "Company", type: "text", hint: "Enough to look you up before the call." },
{ name: "context", label: "What are you building?", type: "text", hint: "One line is plenty. It decides who replies." },
]
export function ContactSalesForm({
heading = "Talk to someone who builds this",
intro = "Three fields, because a fourteen-field form is a way of asking for the meeting twice. You get a reply inside one working day.",
submitLabel = "Request a call",
onSubmit,
className,
}: ContactSalesFormProps) {
// 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}-contact-sales-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}-contact-sales-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}-contact-sales-form-${field.name}`}
className="block text-sm font-medium text-foreground"
>
{field.label}
</label>
<input
id={`${uid}-contact-sales-form-${field.name}`}
name={field.name}
type={field.type}
required
aria-describedby={field.hint ? `${uid}-contact-sales-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}-contact-sales-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/contact-sales-form.tsx and import it where you need the section:
import { ContactSalesForm } from '@/components/contact-sales-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 | "Talk to someone who builds this" |
intro | string | — |
submitLabel | string | "Request a call" |
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.
<!--
Contact Sales 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_-contact-sales-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_-contact-sales-form-heading" class="text-xl font-semibold tracking-tight text-card-foreground">Talk to someone who builds this</h2>
<p class="mt-2 text-sm text-muted-foreground">Three fields, because a fourteen-field form is a way of asking for the meeting twice. You get a reply inside one working day.</p>
<form class="mt-6 space-y-4">
<div>
<label for="_R_0_-contact-sales-form-email" class="block text-sm font-medium text-foreground">Work email</label>
<input id="_R_0_-contact-sales-form-email" type="email" required="" aria-describedby="_R_0_-contact-sales-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_-contact-sales-form-email-hint" class="mt-1 text-xs text-muted-foreground">We reply here. It is never added to a list.</p>
</div>
<div>
<label for="_R_0_-contact-sales-form-company" class="block text-sm font-medium text-foreground">Company</label>
<input id="_R_0_-contact-sales-form-company" type="text" required="" aria-describedby="_R_0_-contact-sales-form-company-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="company" />
<p id="_R_0_-contact-sales-form-company-hint" class="mt-1 text-xs text-muted-foreground">Enough to look you up before the call.</p>
</div>
<div>
<label for="_R_0_-contact-sales-form-context" class="block text-sm font-medium text-foreground">What are you building?</label>
<input id="_R_0_-contact-sales-form-context" type="text" required="" aria-describedby="_R_0_-contact-sales-form-context-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="context" />
<p id="_R_0_-contact-sales-form-context-hint" class="mt-1 text-xs text-muted-foreground">One line is plenty. It decides who replies.</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">Request a call</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 Contact & FormsCopying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
A contact form beside the channels that bypass it — a real address, a support link and a response-time promise, which is what makes a form people cannot see into feel worth filling.
A three-step form where each step validates only its own fields, errors are wired to inputs with aria-describedby, and advancing moves focus to the new heading.
One click to rate, everything after it optional — the shape that collects a complaint from someone mid-task who would never open a contact page.
The state every form reaches and none of them illustrate: a focused summary at the top linking to each bad field, validation that waits for submit, and somewhere for the failure that belongs to no field.
A support form that asks for the one thing that halves resolution time — what you already tried — and says when a human will read it.