Fieldset
Native fieldset and legend wrapper for related controls.
Fieldset groups related controls with native <fieldset> and <legend> semantics.
Use Fieldset when several controls answer one question, such as notification channels or grouped consent.
Anatomy
#default: Grouped controls.#legend: Custom legend content rendered inside<legend>.#description: Custom help text linked witharia-describedby.
The native <fieldset> root and content wrapper are generated by the component. Style them with ui.root and ui.content.
Usage
Examples
Group related fields
Use Fieldset around controls that answer one shared question.
import './main.css'
Disabled group
Native fieldset behavior disables the controls inside it.
<template>
<Accordion
:items="items"
type="multiple"
/>
</template>
Invalid group
Use invalid to mark the whole group when the group-level choice has an error. Fieldset does not render a built-in error region; render group error text in the default slot or use child Field errors for individual controls.
<Dialog
:ui="{
overlay: 'fixed inset-0 bg-black/50',
content: 'fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-lg bg-white p-6',
}"
/>
Custom legend
Use #legend when the group label needs badges, hints, or richer markup.
/* Target by semantic class */
.akaza-dialog-overlay { background: rgba(0, 0, 0, 0.5); }
.akaza-dialog-content { border-radius: 12px; }
/* Target by state */
[data-akaza-state="open"] { opacity: 1; }
[data-akaza-state="checked"] { background: black; }
/* Target by positioning side */
.akaza-tooltip-content[data-akaza-side="top"] { margin-bottom: 8px; }
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
legend | string | — | Fieldset legend. |
description | string | — | Help text linked with aria-describedby. |
disabled | boolean | false | Disables grouped controls via native fieldset behavior. |
invalid | boolean | false | Sets invalid state attributes. |
ui | FieldsetUi | — | Classes for root, legend, description, content. |
Slots
| Slot | Description |
|---|---|
default | Grouped controls. |
legend | Custom legend content. |
description | Custom description content. |
UI Options
| Key | Description |
|---|---|
root | The native fieldset element. |
legend | The legend element. |
description | The description element. |
content | The content wrapper around grouped controls. |
State Attributes
Fieldset sets data-disabled, data-invalid, and matching data-akaza-* attributes.
invalid is a group state only. It does not create an error element or add an error id to aria-describedby; use the description prop for persistent group help text and render transient error text inside the default slot when needed.
Styling Hooks
| UI key | CSS class | Data attrs |
|---|---|---|
root | akaza-fieldset | data-disabled, data-invalid, data-akaza-disabled, data-akaza-invalid |
legend | akaza-fieldset-legend | — |
description | akaza-fieldset-description | — |
content | akaza-fieldset-content | — |