Skip to main content

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...

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

NameTypeDefault
items *
The array of items
CheckboxProps[] | RadioProps[] | SwitchProps[]
type *
The type of elements
"switch" | "checkbox" | "radio"
title
The header title
string
subtitle
The header subtitle
string
alignment
The alignment of elements
"block" | "inline"
"block"
data-{foo}
Data attributes can be used by testing libraries to retrieve components or assert their existence
string
* - the prop is required.
;