Warranty Coverage Panel
A verdict for this serial number today, with exclusions given equal weight to cover and an extension offered only while it can still be bought.
A repair is not a return - a symptom picker that filters the service routes, warranty resolved inside the form, and an estimate with its uncertainty stated.
components/repair-request-form.tsxnpx hoverlab add repair-request-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.
Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.
'use client'
/**
* <RepairRequestForm> — booking a repair, where the quote comes first.
*
* A repair is not a return. The customer wants to keep the thing; they want it
* working. That single difference changes the whole form, and most products
* get it wrong by reusing the returns flow with the word swapped.
*
* WHAT CHANGES BECAUSE IT IS A REPAIR
*
* - **The fault matters more than the product.** A guided symptom picker
* beats a free-text box: it routes the job to the right bench, decides
* whether the unit has to travel at all, and produces an estimate. Free
* text produces a phone call.
* - **There are three service routes, not one.** On-site, send-in, and
* self-service with a posted part. Which are available depends on the
* symptom, so the routes are filtered by it rather than offered blindly and
* refused later.
* - **The estimate is shown before submission, with its uncertainty.** A
* range and an explicit "quoted before any work starts". A repair form that
* submits into silence is a repair the customer chases twice.
*
* WARRANTY STATUS IS RESOLVED IN THE FORM, NOT AFTER IT
*
* The same serial number that identifies the unit decides whether the customer
* pays. Showing that at the point of choosing — covered, so £0; lapsed, so a
* range — is the difference between an informed booking and a surprise
* invoice. It pairs with `warranty-coverage-panel`, which is the read view of
* the same fact.
*
* ACCESSIBILITY: the symptom picker is a radio group whose options carry their
* consequence in text, not just in a badge; the estimate is a polite live
* region because it changes as choices are made; the date input has a real
* `min` so a past date cannot be submitted and then rejected server-side.
*/
import * as React from 'react'
import { Banknote, CircleAlert, Home, Package, ShieldCheck, Wrench } from 'lucide-react'
export interface Symptom {
id: string
label: string
detail: string
/** Routes this symptom can be served by. */
routes: string[]
estimateLow: number
estimateHigh: number
}
export interface ServiceRoute {
id: string
label: string
note: string
icon: typeof Home
}
export interface RepairRequestFormProps {
productName?: string
serial?: string
underWarranty?: boolean
symptoms?: Symptom[]
routes?: ServiceRoute[]
currency?: string
className?: string
}
const DEFAULT_SYMPTOMS: Symptom[] = [
{
id: 'motor',
label: 'Desk will not raise or lower',
detail: 'Handset lights up but nothing moves, or it moves and stops.',
routes: ['onsite', 'part'],
estimateLow: 0,
estimateHigh: 180,
},
{
id: 'wobble',
label: 'Frame wobbles or is uneven',
detail: 'Usually a levelling foot or a loose crossbar, not a fault in the legs.',
routes: ['onsite', 'self'],
estimateLow: 0,
estimateHigh: 60,
},
{
id: 'handset',
label: 'Handset or display is dead',
detail: 'A part swap. The unit does not need to travel.',
routes: ['part', 'self'],
estimateLow: 0,
estimateHigh: 45,
},
{
id: 'surface',
label: 'Desktop surface is damaged',
detail: 'Splitting, delamination or a lifting edge. Needs an inspection.',
routes: ['onsite', 'sendin'],
estimateLow: 90,
estimateHigh: 340,
},
]
const DEFAULT_ROUTES: ServiceRoute[] = [
{ id: 'onsite', label: 'Engineer visits', note: '5–9 working days · half-day window', icon: Home },
{ id: 'sendin', label: 'Send it in', note: '10–14 working days · we collect', icon: Package },
{ id: 'part', label: 'We post the part', note: '2–3 working days · you fit it', icon: Wrench },
{ id: 'self', label: 'Guided self-service', note: 'Same day · instructions and a video call', icon: ShieldCheck },
]
const INPUT_CLASS =
'w-full rounded-lg border border-border bg-background px-3 py-2 text-sm outline-none transition-colors focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-ring'
export function RepairRequestForm({
productName = 'Kestrel sit-stand desk',
serial = 'KS-2291-8840',
underWarranty = true,
symptoms = DEFAULT_SYMPTOMS,
routes = DEFAULT_ROUTES,
currency = '£',
className = '',
}: RepairRequestFormProps) {
const uid = React.useId()
const [symptomId, setSymptomId] = React.useState(symptoms[0]?.id ?? '')
const [routeId, setRouteId] = React.useState('')
const symptom = symptoms.find((s) => s.id === symptomId)
// Routes are filtered by the symptom rather than offered and then refused.
const available = routes.filter((route) => symptom?.routes.includes(route.id))
// A route the new symptom does not offer must not stay selected. Derived
// rather than reset in an effect: the effect would have to depend on a
// freshly built array and would run on every render to do nothing.
const chosenRoute = available.some((r) => r.id === routeId) ? routeId : ''
const cost = underWarranty
? 'No charge — this unit is under warranty'
: symptom
? symptom.estimateLow === symptom.estimateHigh
? `${currency}${symptom.estimateHigh}`
: `${currency}${symptom.estimateLow}–${currency}${symptom.estimateHigh}`
: '—'
return (
<section className={`bg-background px-4 py-10 sm:px-6 ${className}`}>
<form className="mx-auto max-w-3xl" onSubmit={(e) => e.preventDefault()}>
<h2 className="text-xl font-bold tracking-tight">Book a repair</h2>
<p className="mt-1 text-sm text-muted-foreground">
{productName} · serial <span className="font-mono text-xs">{serial}</span>
</p>
{/* Resolved here, not after submission. */}
<p
className={`mt-4 inline-flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium ${
underWarranty
? 'bg-emerald-500/10 text-emerald-700 dark:text-emerald-400'
: 'bg-muted text-muted-foreground'
}`}
>
{underWarranty ? (
<ShieldCheck aria-hidden className="h-4 w-4" />
) : (
<CircleAlert aria-hidden className="h-4 w-4" />
)}
{underWarranty
? 'Under warranty until 12 March 2027 — parts and labour included'
: 'Out of warranty since 19 January 2025 — chargeable, quoted first'}
</p>
<fieldset className="mt-6 border-0 p-0">
<legend className="text-sm font-semibold">What is wrong with it?</legend>
<div className="mt-3 space-y-2">
{symptoms.map((option) => {
const id = `${uid}-s-${option.id}`
const on = symptomId === option.id
return (
<div key={option.id}>
<input
type="radio"
id={id}
name={`${uid}-symptom`}
checked={on}
onChange={() => setSymptomId(option.id)}
className="peer sr-only"
/>
<label
htmlFor={id}
className={`block cursor-pointer rounded-xl border p-3 transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring ${
on ? 'border-primary bg-primary/5' : 'border-border hover:bg-muted/60'
}`}
>
<span className="text-sm font-medium">{option.label}</span>
<span className="mt-0.5 block text-xs text-muted-foreground">
{option.detail}
</span>
</label>
</div>
)
})}
</div>
</fieldset>
<fieldset className="mt-6 border-0 p-0">
<legend className="text-sm font-semibold">
How should we do it?
<span className="ms-2 text-xs font-normal text-muted-foreground">
{available.length} of {routes.length} routes suit this fault
</span>
</legend>
<div className="mt-3 grid gap-2 sm:grid-cols-2">
{available.map((route) => {
const Icon = route.icon
const id = `${uid}-r-${route.id}`
const on = chosenRoute === route.id
return (
<div key={route.id}>
<input
type="radio"
id={id}
name={`${uid}-route`}
checked={on}
onChange={() => setRouteId(route.id)}
className="peer sr-only"
/>
<label
htmlFor={id}
className={`block h-full cursor-pointer rounded-xl border p-3 transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring ${
on ? 'border-primary bg-primary/5' : 'border-border hover:bg-muted/60'
}`}
>
<span className="flex items-center gap-1.5 text-sm font-medium">
<Icon aria-hidden className="h-4 w-4" />
{route.label}
</span>
<span className="mt-0.5 block text-xs text-muted-foreground">
{route.note}
</span>
</label>
</div>
)
})}
</div>
</fieldset>
<div className="mt-6 grid gap-4 sm:grid-cols-2">
<div>
<label htmlFor={`${uid}-from`} className="block text-sm font-medium">
Earliest date that suits you
</label>
<input
id={`${uid}-from`}
type="date"
// A past date cannot be submitted and then refused server-side.
min="2026-09-14"
defaultValue="2026-09-21"
className={`mt-1.5 ${INPUT_CLASS}`}
/>
</div>
<div>
<label htmlFor={`${uid}-phone`} className="block text-sm font-medium">
Phone for the engineer
</label>
<input
id={`${uid}-phone`}
type="tel"
autoComplete="tel"
placeholder="+31 6 1234 5678"
className={`mt-1.5 ${INPUT_CLASS}`}
/>
</div>
<div className="sm:col-span-2">
<label htmlFor={`${uid}-detail`} className="block text-sm font-medium">
Anything the picker did not cover
<span className="ms-2 text-xs font-normal text-muted-foreground">Optional</span>
</label>
<textarea
id={`${uid}-detail`}
rows={3}
placeholder="It only fails going down, and only past about 90 cm."
className={`mt-1.5 ${INPUT_CLASS}`}
/>
</div>
</div>
<div
aria-live="polite"
className="mt-6 flex flex-wrap items-center justify-between gap-4 rounded-xl border border-border bg-card p-4"
>
<div>
<p className="flex items-center gap-1.5 text-sm font-semibold">
<Banknote aria-hidden className="h-4 w-4 text-primary" />
Estimate: {cost}
</p>
<p className="mt-1 max-w-md text-xs text-muted-foreground">
An estimate, not a quote. Nothing is charged until an engineer has
seen the fault and you have accepted a figure in writing.
</p>
</div>
<button
type="submit"
disabled={!chosenRoute}
className="rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground transition-opacity hover:opacity-90 disabled:opacity-40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card"
>
Request the repair
</button>
</div>
</form>
</section>
)
}
bg-card, text-muted-foreground) — it inherits your theme instead of overriding it.Drop it at components/repair-request-form.tsx and import it where you need the section:
import { RepairRequestForm } from '@/components/repair-request-form'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 |
|---|---|---|
productName | string | 'Kestrel sit-stand desk' |
serial | string | 'KS-2291-8840' |
underWarranty | boolean | true |
symptoms | Symptom[] | DEFAULT_SYMPTOMS |
routes | ServiceRoute[] | DEFAULT_ROUTES |
currency | string | '£' |
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.
<!--
Service Repair 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.
-->
<section class="bg-background px-4 py-10 sm:px-6 ">
<form class="mx-auto max-w-3xl">
<h2 class="text-xl font-bold tracking-tight">Book a repair</h2>
<p class="mt-1 text-sm text-muted-foreground">Kestrel sit-stand desk · serial <span class="font-mono text-xs">KS-2291-8840</span></p>
<p class="mt-4 inline-flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"><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-shield-check h-4 w-4" aria-hidden="true"><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"></path><path d="m9 12 2 2 4-4"></path></svg>Under warranty until 12 March 2027 — parts and labour included</p>
<fieldset class="mt-6 border-0 p-0">
<legend class="text-sm font-semibold">What is wrong with it?</legend>
<div class="mt-3 space-y-2">
<div>
<input type="radio" id="_R_0_-s-motor" class="peer sr-only" name="_R_0_-symptom" checked="" />
<label for="_R_0_-s-motor" class="block cursor-pointer rounded-xl border p-3 transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring border-primary bg-primary/5">
<span class="text-sm font-medium">Desk will not raise or lower</span>
<span class="mt-0.5 block text-xs text-muted-foreground">Handset lights up but nothing moves, or it moves and stops.</span>
</label>
</div>
<div>
<input type="radio" id="_R_0_-s-wobble" class="peer sr-only" name="_R_0_-symptom" />
<label for="_R_0_-s-wobble" class="block cursor-pointer rounded-xl border p-3 transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring border-border hover:bg-muted/60">
<span class="text-sm font-medium">Frame wobbles or is uneven</span>
<span class="mt-0.5 block text-xs text-muted-foreground">Usually a levelling foot or a loose crossbar, not a fault in the legs.</span>
</label>
</div>
<div>
<input type="radio" id="_R_0_-s-handset" class="peer sr-only" name="_R_0_-symptom" />
<label for="_R_0_-s-handset" class="block cursor-pointer rounded-xl border p-3 transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring border-border hover:bg-muted/60">
<span class="text-sm font-medium">Handset or display is dead</span>
<span class="mt-0.5 block text-xs text-muted-foreground">A part swap. The unit does not need to travel.</span>
</label>
</div>
<div>
<input type="radio" id="_R_0_-s-surface" class="peer sr-only" name="_R_0_-symptom" />
<label for="_R_0_-s-surface" class="block cursor-pointer rounded-xl border p-3 transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring border-border hover:bg-muted/60">
<span class="text-sm font-medium">Desktop surface is damaged</span>
<span class="mt-0.5 block text-xs text-muted-foreground">Splitting, delamination or a lifting edge. Needs an inspection.</span>
</label>
</div>
</div>
</fieldset>
<fieldset class="mt-6 border-0 p-0">
<legend class="text-sm font-semibold">How should we do it?<span class="ms-2 text-xs font-normal text-muted-foreground">2 of 4 routes suit this fault</span></legend>
<div class="mt-3 grid gap-2 sm:grid-cols-2">
<div>
<input type="radio" id="_R_0_-r-onsite" class="peer sr-only" name="_R_0_-route" />
<label for="_R_0_-r-onsite" class="block h-full cursor-pointer rounded-xl border p-3 transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring border-border hover:bg-muted/60">
<span class="flex items-center gap-1.5 text-sm font-medium"><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-house h-4 w-4" aria-hidden="true"><path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"></path><path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path></svg>Engineer visits</span>
<span class="mt-0.5 block text-xs text-muted-foreground">5–9 working days · half-day window</span>
</label>
</div>
<div>
<input type="radio" id="_R_0_-r-part" class="peer sr-only" name="_R_0_-route" />
<label for="_R_0_-r-part" class="block h-full cursor-pointer rounded-xl border p-3 transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring border-border hover:bg-muted/60">
<span class="flex items-center gap-1.5 text-sm font-medium"><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-wrench h-4 w-4" aria-hidden="true"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path></svg>We post the part</span>
<span class="mt-0.5 block text-xs text-muted-foreground">2–3 working days · you fit it</span>
</label>
</div>
</div>
</fieldset>
<div class="mt-6 grid gap-4 sm:grid-cols-2">
<div>
<label for="_R_0_-from" class="block text-sm font-medium">Earliest date that suits you</label>
<input id="_R_0_-from" type="date" min="2026-09-14" class="mt-1.5 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm outline-none transition-colors focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-ring" value="2026-09-21" />
</div>
<div>
<label for="_R_0_-phone" class="block text-sm font-medium">Phone for the engineer</label>
<input id="_R_0_-phone" type="tel" autoComplete="tel" placeholder="+31 6 1234 5678" class="mt-1.5 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm outline-none transition-colors focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-ring" />
</div>
<div class="sm:col-span-2">
<label for="_R_0_-detail" class="block text-sm font-medium">Anything the picker did not cover<span class="ms-2 text-xs font-normal text-muted-foreground">Optional</span></label>
<textarea id="_R_0_-detail" rows="3" placeholder="It only fails going down, and only past about 90 cm." class="mt-1.5 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm outline-none transition-colors focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-ring"></textarea>
</div>
</div>
<div aria-live="polite" class="mt-6 flex flex-wrap items-center justify-between gap-4 rounded-xl border border-border bg-card p-4">
<div>
<p class="flex items-center gap-1.5 text-sm font-semibold"><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-banknote h-4 w-4 text-primary" aria-hidden="true"><rect width="20" height="12" x="2" y="6" rx="2"></rect><circle cx="12" cy="12" r="2"></circle><path d="M6 12h.01M18 12h.01"></path></svg>Estimate: No charge — this unit is under warranty</p>
<p class="mt-1 max-w-md text-xs text-muted-foreground">An estimate, not a quote. Nothing is charged until an engineer has seen the fault and you have accepted a figure in writing.</p>
</div>
<button type="submit" disabled="" class="rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground transition-opacity hover:opacity-90 disabled:opacity-40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card">Request the repair</button>
</div>
</form>
</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.
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 After-Sale ServiceCopying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
A verdict for this serial number today, with exclusions given equal weight to cover and an extension offered only while it can still be bought.
Refunds are per line, not per order: a reason on each line that drives what is asked for next, and a running total itemising the restocking fee and the delivery rule.
Where the money is and who is holding it - four stages, each naming the responsible party, including the bank stage every where-is-my-refund contact comes from.
The operator queue, sorted oldest-open-first because recency is the wrong default, with blocked as a first-class status that names its blocker.
Refund, exchange or credit decided per line, with live stock on the variants and the price difference shown before the goods are posted rather than after.
The screen between approved and posted: three drop-off methods with the thing that actually blocks each one, the packing rules that get returns refused, and a date rather than a duration.
The reviews you wrote and the ones you owe, with editing that is honest about being marked as edited and moderation that names the rule it applied.
A balance checker built for the two ways it goes wrong - an empty card and an expired one - answering with a transaction history rather than a bare zero.