Skip to content
Alea0.1

Forms

Fieldset

Groups related fields under a legend, with an optional description, and can disable them all.

Ant Design: Form groups

import { Fieldset } from '@alea/ui';

Examples

Grouped fields

The legend is read when people enter the group.

Shipping address

Where we send the order.

Billing address

Props

Fieldset props

Groups related fields under a legend: an address, a payment method (Mantine Fieldset, HTML fieldset).

PropTypeDefaultDescription
legendrequiredReactNode-The group's name, read before each field in it.
classNamestring-Extra class names for the root element.
descriptionReactNode-One sentence under the legend, linked to the group.
isDisabledboolean-Disables every field inside.
variant"filled" | "plain"'filled'filled (a panel, default) or plain.

Accessibility

  • A real fieldset and legend: screen readers announce the legend when entering the group.

Keyboard

KeyDoes
TabMoves into the fields; the legend is announced

Do and don't

Do

  • Group fields that answer one question (an address, a card).
  • Use the description for rules that apply to every field inside.

Don't

  • Don't nest fieldsets more than once.
  • Don't use a fieldset around a single field.
Tested with axe, keyboard and screen reader roles