Styling
The form ships as plain, accessible HTML. You choose who owns its look: our finished style, or your site’s own CSS.
Our finished look
Section titled “Our finished look”import "@seaforms/react/theme.css";- It takes your page’s font, text size and text colour. Every grey is mixed from that colour, so it reads right on light and dark sites, and every size is relative to the form’s text.
- It holds its ground. Rules your site writes for every input, button or label (Bootstrap, Pico, a theme) stop at the form’s edge. Fonts and colours still flow in.
- Make it yours with variables, set on any selector. They sit at zero weight, so yours always win:
[data-sf="form"] { --sf-accent: #0ea5e9; --sf-on-accent: #fff; --sf-radius: 0.5em; --sf-control-height: 3em;}| Variable | Default | What it sets |
|---|---|---|
--sf-accent |
#2563eb |
buttons, picked options, focus and progress |
--sf-on-accent |
#fff |
text on the accent |
--sf-radius |
.75em |
corners |
--sf-control-height |
2.875em |
fields and buttons |
--sf-gap |
.625em |
space between options |
--sf-field |
a 4% tint of your text colour | a field’s fill |
--sf-field-line |
a 20% tint | a field’s border |
--sf-line, --sf-line-strong |
20% and 34% tints | borders and dividers |
--sf-muted |
66% of your text colour | help text and progress |
--sf-placeholder |
from --sf-muted |
placeholders |
--sf-danger |
a red leaning toward your text colour | errors, readable on light and dark |
--sf-title-font, --sf-title-size, --sf-title-weight |
your font, 1.25em, 650 |
step titles and thank-yous |
--sf-title-tracking, --sf-title-transform |
-.01em, none |
the same, for headings in capitals or a display face |
--sf-pay-height |
22em |
the room kept for Stripe’s card fields |
Your own styles
Section titled “Your own styles”Leave theme.css out, and only the structure ships: layout, the room kept for errors, and the rules that keep the form from shifting. Every element carries data-sf="<part>", and classNames puts your classes on any part.
<Form schema={contact} className="grid gap-5" classNames={{ field: "grid gap-1.5", label: "text-sm font-medium", input: "h-11 rounded-lg border border-zinc-300 px-3", textarea: "min-h-32 rounded-lg border border-zinc-300 p-3", error: "text-sm text-red-600", "button-submit": "h-11 rounded-lg bg-zinc-900 px-5 font-medium text-white", }}/>[data-sf="label"] { font-weight: 500;}[data-sf="input"],[data-sf="textarea"] { border: 1px solid #d4d4d8; border-radius: 8px;}[data-sf="error"] { color: #dc2626;}[data-sf="button-submit"] { background: #18181b; color: #fff;}Chips, cards, segmented buttons, stars and steppers are real radio buttons, tick boxes and inputs underneath. Unstyled, they fall back to plain radio buttons and tick boxes, so the form always works with the keyboard, with screen readers and without JavaScript.
Every part
Section titled “Every part”New parts are only ever added: renaming or removing one would break your styles, so it counts as a breaking change.
formstepsstepstep-titlestep-descriptionblocksprogressprogress-segmentprogress-textresumescreensscreenquestion-numberintrochoice-keyhintprogress-fillgroupgroup-titlegroup-descriptionfieldlabelrequiredoptionalhelpinputtextareaselectaffixchoiceschoicechoice-inputchoice-labelchoice-descriptionchoice-priceswatchchoice-imageother-inputquantityquantity-buttonquantity-valueratingrating-itemfilefile-dropfile-itembookingbooking-monthbooking-month-namebooking-navbooking-weekdaysbooking-weekdaybooking-daysbooking-daybooking-zonebooking-timesbooking-day-namebooking-time-listbooking-timebooking-notebooking-retrysummarysummary-titlesummary-linesummary-totalsummary-depositsummary-balancereviewreview-itemreview-editpaymentpayment-amountpayment-boxpayment-test-bannerpayment-elementpayment-notepayment-retrycouponcoupon-inputcoupon-buttoncoupon-resulterrorcheck-errornavbutton-backbutton-nextbutton-submitbutton-savesavesave-titlesave-bodysave-inputsave-buttonsave-backsave-noteendingending-titleending-bodycontentdividerimagebadgeclosedturnstilestatusChatGPT is a trademark of OpenAI, and Claude and Claude Code are trademarks of Anthropic. Other product names and logos belong to their owners. None of them makes or endorses Seaforms. Trademarks