FormSection
FormSection groups related form fields under an optional title, description, divider, and action row.
Quick Start
from faststrap import Button, FormSection, Input
FormSection(
Input(name="name", label="Name"),
Input(name="email", label="Email", type="email"),
title="Profile",
description="Public account details.",
actions=Button("Save", variant="primary"),
)
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
*fields |
Any |
required | Field components or arbitrary content. |
title |
str | None |
None |
Section heading. |
description |
str | None |
None |
Muted helper copy below the heading. |
actions |
Any | list[Any] | tuple[Any, ...] | None |
None |
Right-aligned section actions. |
divider |
bool |
True |
Adds a top border and spacing before the section. |
**kwargs |
Any |
{} |
Additional HTML/HTMX/data/ARIA attributes. |
Notes
- Use
divider=Falsefor the first section in a form. FormSectionis layout-only; validation still belongs toFormGroup,LiveValidationField, and server-side form handling.
API Reference
faststrap.components.forms.form_section.FormSection(*fields, title=None, description=None, actions=None, divider=True, **kwargs)
Group related form controls under a section heading.