Fieldset
Installation
Usage
Root is a native fieldset and Legend is its native legend. Keep Legend first so it names the group. Description is optional prose; give it an ID and pass that ID through Root’s aria-describedby when it explains the whole group.
UseField for individual labels and errors. Use Field.Group when you need spacing without another named group. Native name, form, disabled, event handlers, attachments, and an element binding are forwarded by Root.
Disable a group
A disabled fieldset disables its native descendant controls and excludes their values from submission. Controls inside its first legend are exempt under native HTML rules. Keep an external “Edit” action outside the fieldset if it must remain available.
Compose the group
Legend and Description are independent parts. Omit Description for a self-explanatory group; keep Legend for a meaningful accessible name. Put grids and nested Field.Group parts inside Root to change the layout without changing the form’s submission behavior. The default uses spacing rather than a decorative card border.
API reference
Fieldset.Root
| Prop | Type | Default |
|---|---|---|
element Bindable | HTMLFieldSetElement | undefined | — |
pnpm dlx @mielui/svelte add fieldset field input