Skip to content
satin

Form

Lays out fields, groups and sections, hands them errors by name and focuses the first one.

Profile

How your team sees you.

We send receipts here.

Notifications

Email me about

Installation

Terminal
npm i @uisatin/ui
Import
import { Form, FormSection, FormActions } from '@uisatin/ui/form'

About 10.4 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.

First time with Satin? Set it up once, styles and fonts included, with the installation guide.

API Reference

The Form component is a wrapper around the form element that lays out FormFields, FieldGroups, FormSections and FormActions, gives them one layout, hands each its error by name and focuses the first invalid control after a submit.

PropTypeDefault
layout
"vertical""horizontal"
"vertical"
errors
Record<string, ReactNode>
—
disabled
boolean
false
onSubmitValues
(values, event) => void
—
noValidate
boolean
true
className
string
—
ref
Ref<HTMLFormElement>
—
...props
ComponentProps<'form'>

Other attributes go to <form>

—

Accessibility

A native form with noValidate on by default, so your own messages replace the browser’s. After a submit, when errors appear, focus moves to the first control with aria-invalid="true", so keyboard and screen-reader users land on what needs fixing. Messages from errors reach each field by name. disabled wraps the fields in a native fieldset, which disables every control inside. FormSection is a section labelled by its h3 title.