Choice cards in React
Radio buttons presented as selectable cards, to pick a plan or an option.
Here is an excerpt of this component's code in React. The full code is free for members, ready to copy into your project.
This component also comes in
The code in React
export function ChoiceCards() {
return (
<div className="mx-auto w-[min(100%_-_2rem,48rem)] py-8">
<fieldset className="grid gap-3 sm:grid-cols-3">
<legend className="mb-3 text-lg font-bold sm:col-span-3">Choisissez votre formule</legend>
<label
htmlFor="plan-solo"
className="group relative grid cursor-pointer gap-0.5 rounded-[14px] border-2 border-violet-200 bg-white py-4 pr-12 pl-4.5 has-checked:border-3 has-checked:border-violet-700 has-checked:bg-violet-50 has-focus-visible:outline-2 has-focus-visible:outline-offset-3 has-focus-visible:outline-violet-700 dark:border-[#34246a] dark:bg-[#140b2b] dark:has-checked:border-violet-300 dark:has-checked:bg-[#22134a] dark:has-focus-visible:outline-violet-300"
>
<input
id="plan-solo"
type="radio"Free component: copy it freely, including for commercial projects.
Other forms and inputs components in React
Forms and inputs components in React
A quote request form for tradespeople: the customer describes the work, picks a start date range and attaches up to six site photos, each with a preview, its size and a button to remove it.
- Tailwind
- React
- CSS
- WordPress

A quote request form whose labels, hints and error messages are full French sentences, still readable at 320 px: nothing overflows, nothing is cut off, and each error is tied to its field.
- Tailwind
- React
- CSS
- WordPress

Visitors pick a package and tick options: the pre-tax total, VAT and total including tax update live, and the summary is sent with the contact form.
- Tailwind
- React
- CSS
- WordPress

A short NPS survey: a 0 to 10 score as radio buttons, then a follow-up question adapted to whether the customer is a detractor, passive or promoter.
- Tailwind
- React
- CSS
- WordPress

An honest unsubscribe page: address prefilled from the link, choice between stopping everything or receiving less, optional reason and an undo.
- Tailwind
- React
- CSS
- WordPress

A callback request form: French phone number checked and formatted, topic, working day and time slot, with explicit consent to the call.
- Tailwind
- React
- CSS
- WordPress