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 support form that asks for the one thing that halves resolution time — what you already tried — and says when a human will read it.
components/support-ticket-form.tsxnpx hoverlab add support-ticket-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.
Most tickets take two round trips because the first reply has to ask what was already tried. This asks up front, and the answer is optional so it never blocks sending.
Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.
'use client'
/**
* <SupportTicketForm> — 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.
*
* The layout problem is that a support form has two audiences with opposite
* interests. The person filling it in wants to send it now; the person
* answering it wants context. The obvious wrong answer is to serve the
* second at the first's expense — a required "steps to reproduce" field is
* how a form gets abandoned in favour of an email.
*
* So the third field asks the one question that reliably removes a round
* trip, and it is optional. An optional field with a stated reason gets
* filled in far more often than a required field with none, and nothing is
* blocked when it does not.
*
* The intro states the reply window rather than promising a fast one. "Weekdays, inside four hours" is checkable; "we'll get back to you as soon
* as possible" is what people have learned means nothing.
*
* Accessibility: `htmlFor`/`id` label association so the hints ride on
* `aria-describedby` rather than being loose text after the input, and a
* `role="status"` region rendered empty on first paint. That second one is
* what makes the confirmation audible — a region that did not exist at load
* is frequently never announced, and on a form whose success state is a
* sentence, an unannounced sentence is no success state at all.
*
* The demo defaults to `idle` with an empty message, which is the state
* every reader arrives in and the reason the region reserves its height.
*/
import * as React from 'react'
export interface SupportTicketFormProps {
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 SupportTicketFormField {
name: string
label: string
type: string
hint?: string
}
const FIELDS: SupportTicketFormField[] = [
{ name: "email", label: "Email", type: "email", hint: "Where the reply goes. Weekdays, inside four hours." },
{ name: "summary", label: "What happened?", type: "text", hint: "One sentence. The detail goes below." },
{ name: "tried", label: "What have you already tried?", type: "text", hint: "Optional, and the field that saves a round trip." },
]
export function SupportTicketForm({
heading = "Tell us what broke",
intro = "Most tickets take two round trips because the first reply has to ask what was already tried. This asks up front, and the answer is optional so it never blocks sending.",
submitLabel = "Send ticket",
onSubmit,
className,
}: SupportTicketFormProps) {
// 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}-support-ticket-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}-support-ticket-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}-support-ticket-form-${field.name}`}
className="block text-sm font-medium text-foreground"
>
{field.label}
</label>
<input
id={`${uid}-support-ticket-form-${field.name}`}
name={field.name}
type={field.type}
required
aria-describedby={field.hint ? `${uid}-support-ticket-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}-support-ticket-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/support-ticket-form.tsx and import it where you need the section:
import { SupportTicketForm } from '@/components/support-ticket-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 | "Tell us what broke" |
intro | string | — |
submitLabel | string | "Send ticket" |
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.
<!--
Support Ticket 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_-support-ticket-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_-support-ticket-form-heading" class="text-xl font-semibold tracking-tight text-card-foreground">Tell us what broke</h2>
<p class="mt-2 text-sm text-muted-foreground">Most tickets take two round trips because the first reply has to ask what was already tried. This asks up front, and the answer is optional so it never blocks sending.</p>
<form class="mt-6 space-y-4">
<div>
<label for="_R_0_-support-ticket-form-email" class="block text-sm font-medium text-foreground">Email</label>
<input id="_R_0_-support-ticket-form-email" type="email" required="" aria-describedby="_R_0_-support-ticket-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_-support-ticket-form-email-hint" class="mt-1 text-xs text-muted-foreground">Where the reply goes. Weekdays, inside four hours.</p>
</div>
<div>
<label for="_R_0_-support-ticket-form-summary" class="block text-sm font-medium text-foreground">What happened?</label>
<input id="_R_0_-support-ticket-form-summary" type="text" required="" aria-describedby="_R_0_-support-ticket-form-summary-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="summary" />
<p id="_R_0_-support-ticket-form-summary-hint" class="mt-1 text-xs text-muted-foreground">One sentence. The detail goes below.</p>
</div>
<div>
<label for="_R_0_-support-ticket-form-tried" class="block text-sm font-medium text-foreground">What have you already tried?</label>
<input id="_R_0_-support-ticket-form-tried" type="text" required="" aria-describedby="_R_0_-support-ticket-form-tried-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="tried" />
<p id="_R_0_-support-ticket-form-tried-hint" class="mt-1 text-xs text-muted-foreground">Optional, and the field that saves a round trip.</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">Send ticket</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 qualifying contact form that asks the three things a first reply needs, and says what happens next before you send it.