Fieldset
Anatomy
Groups related form controls with an optional legend and disabled state.
maud_ui::primitives::fieldset
Props
Generated from public Rust fields. Defaults are evaluated from the implementation.
| Prop | Type | Default | Description |
|---|---|---|---|
legend | String | "Fieldset" | No description |
disabled | bool | false | No description |
children | Markup | PreEscaped("") | No description |
Examples
Profile Fieldset
Disabled Fieldset
Usage and composition
Import
use maud_ui::primitives::fieldset::{self, Props};
Example
use maud::html;
use maud_ui::primitives::fieldset;
html! {
(fieldset::render(fieldset::Props {
legend: "Personal Information".to_string(),
disabled: false,
children: html! {
input.mui-input type="text" placeholder="First Name";
input.mui-input type="text" placeholder="Last Name";
},
}))
}
Related
- Field — individual form control with label/description/error.
- Field Group Helper — vertical stack without border.
Shadcn Reference
Minimal fieldset wrapper for semantic HTML grouping. Use with Field components inside.
Accessibility
- Renders as semantic HTML
<fieldset>+<legend>. - Legend announces the group purpose to screen readers.
- Disabled state propagates to child inputs.
- Implicit
role="group"from<fieldset>element.