Skip to content
satin

Field group

Fields or options that answer one question, under one legend, with one error.

Billing address

As it appears on your invoices.

Installation

Terminal
npm i @uisatin/ui
Import
import { FieldGroup } from '@uisatin/ui/field-group'

About 10.5 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 FieldGroup component is a fieldset with a legend, a description and one error for fields or options that answer one question.

PropTypeDefault
legend
ReactNode
—
variant
"fields""choices"
"fields"
columns
123
1
layout
"vertical""horizontal"
"vertical"
description
ReactNode
—
error
ReactNode
—
name
string
—
required
boolean
false
disabled
boolean
false
className
string
—
ref
Ref<HTMLFieldSetElement>
—
...props
ComponentProps<'fieldset'>

Other attributes go to <fieldset>

—

Accessibility

A native fieldset: the legend names the whole group for screen readers, and disabled reaches every control in it. The description and the error are linked with aria-describedby. The required mark is hidden, so set required on the controls too. After a submit with errors, Form focuses the first control of an invalid group, in document order with the other fields.