Fieldset
VFieldset groups related controls in a native <fieldset> named by its legend, with a hint and an error message.
Usage
vue
Examples
Horizontal
orientation="horizontal" lays the controls out in a wrapping row.
vue
Error and required
error replaces the hint, describes the group and is announced when it appears. A group cannot carry aria-invalid: bind the slot’s invalid and required on the controls.
vue
Hidden legend
hideLegend hides the legend visually. It still names the group for screen readers.
vue
API
Props
| Prop | Type | Default |
|---|---|---|
legend | string | none |
| Legend naming the group. | ||
hint | string | none |
Help text below the group, linked through aria-describedby. | ||
error | string | none |
Error message shown in place of the hint, linked through aria-describedby and announced when it appears. Sets the slot’s invalid. | ||
required | boolean | false |
Adds an asterisk after the legend and sets the slot’s required. | ||
hideLegend | boolean | false |
| Hides the legend visually while keeping it as the group name. | ||
orientation | FieldsetOrientation'vertical' | 'horizontal' | 'vertical' |
| Lays the controls out in a column or a wrapping row. | ||
Slots
| Slot | Type |
|---|---|
default | { invalid: boolean; required: boolean; } |
The controls. Bind invalid and required on them. | |