Fieldset
The Fieldset component is designed to group multiple checkboxes, radiobuttons, and switches into a single container. This component helps improve the readability and organization of your form by clearly indicating which inputs are related to each other.
Example
Live Editor
Result
Loading...
Variants
Alignment
Fieldset alignment
can align elements as block
(default), or inline
.
Please note that inline alignment is not recommended for more than 3 options.
Live Editor
Result
Loading...
Header
Fieldset headers can contain a title
and a subtitle
. It’s recommended to make use of the title, but the subtitle should only be used when extra introductions are required.
Live Editor
Result
Loading...
Types
Fieldset type
supports only checkbox
, radio
, or switch
elements.
The prop items
defines the array of relavant props which Checkbox, Radio and Switch components are supporting.
Live Editor
Result
Loading...
Props
Name | Type | Default |
---|---|---|
items * The array of items |
| — |
type * The type of elements |
| — |
title The header title |
| — |
subtitle The header subtitle |
| — |
alignment The alignment of elements |
| "block" |
data-{foo} Data attributes can be used by testing libraries to retrieve components or assert their existence |
| — |
* - the prop is required. |