Fieldset
v0.0.10
mix mishka.ui.gen.component fieldset
Fieldset component
Fieldset component
A fieldset is an HTML element used to group related input fields within a form. It helps in organizing form elements, making the structure clearer and more accessible, particularly for screen readers. By enclosing inputs and their labels within a fieldset, you can create a logical grouping of form controls that are related in purpose. A legend element is often included within a fieldset to provide a caption or description for the group of fields. This improves the form's usability, ensuring a better user experience by visually and structurally grouping related information together.
Fieldset component
<.fieldset space="medium" color="warning">
<:control>
<.checkbox_field
name="example"
label="Fieldset group of checkboxes"
/>
</:control>
<:control>
<.checkbox_field
name="example"
label="Fieldset group of checkboxes"
/>
</:control>
<:control>
<.checkbox_field
name="example"
label="Fieldset group of checkboxes"
checked
/>
</:control>
</.fieldset>Fieldset legend prop
A fieldset groups related form inputs, while the legend provides a title for that group. Placed at the start of the fieldset, the legend offers context and improves accessibility by clearly describing the purpose of the grouped fields, enhancing form clarity and usability.
Fieldset legend prop
<.fieldset legend="Label">
<:control>
<.checkbox_field
name="example"
label="Fieldset group of checkboxes"
/>
</:control>
<:control>
<.checkbox_field
name="example"
label="Fieldset group of checkboxes"
/>
</:control>
<:control>
<.checkbox_field
name="example"
label="Fieldset group of checkboxes"
checked
/>
</:control>
</.fieldset>Attributes
| Name | Type | Default | Values | Required | Description |
|---|---|---|---|---|---|
id
|
string
| — | — | No | A unique identifier is used to manage state and interaction |
class
|
any
| — | — | No | Custom CSS class for additional styling |
color
|
string
|
natural
|
basenaturalwhiteprimarysecondarydarksuccesswarningdangerinfosilvermiscdawn
| No | Determines color theme |
border
|
string
|
extra_small
| — | No | Determines border style |
rounded
|
string
|
small
|
extra_smallsmallmediumlargeextra_largefullnone
| No | Determines the border radius |
padding
|
string
|
small
|
extra_smallsmallmediumlargeextra_large
| No | Determines padding for items |
variant
|
string
|
base
|
defaultoutlineborderedshadowtransparentgradientbase
| No | Determines the style |
space
|
string
|
medium
|
extra_smallsmallmediumlargeextra_largenone
| No | Space between items |
fieldset_class
|
string
| — | — | No | Custom class for fieldset |
legend_class
|
string
| — | — | No | Custom class for legend |
fieldset_wrapper_class
|
string
| — | — | No | Custom class for wrapper |
size
|
string
|
extra_large
|
extra_smallsmallmediumlargeextra_large
| No | Determines the overall size of the elements, including padding, font size, and other items |
error_icon
|
string
| — | — | No | Icon to be displayed alongside error messages |
legend
|
string
| — | — | No | Determines a caption for the content of its parent |
errors
|
list
|
[]
| — | No | List of error messages to be displayed |
name
|
any
| — | — | No | Name of input |
value
|
any
| — | — | No | Value of input |
rest
|
global
| — | — | No | Global attributes can define defaults which are merged with attributes provided by the caller |
Slots
| Name | Required | Description |
|---|---|---|
control
| No | Defines a collection of elements inside the fieldset |
Options
Each option takes one or more of its values, separated by commas.
| Option | Values |
|---|---|
--variant
|
defaultoutlineborderedshadowtransparentgradientbase
|
--color
|
basenaturalwhiteprimarysecondarydarksuccesswarningdangerinfosilvermiscdawn
|
--size
|
extra_smallsmallmediumlargeextra_large
|
--space
|
extra_smallsmallmediumlargeextra_largenone
|
--padding
|
extra_smallsmallmediumlargeextra_large
|
--rounded
|
extra_smallsmallmediumlargeextra_largefullnone
|
--module
| A module name of your own |
What it generates
mix mishka.ui.gen.component fieldset