Basic Usage
Labels can contain text directly or wrap other components.With Form Fields
Labels are typically paired with inputs and other form controls:Optional Indicator
Setoptional=True to show a muted “optional” hint after the label text. Form.from_model() sets this automatically for non-required fields; for manually built forms, set it yourself on any label.
API Reference
Label Parameters
Label text content. Can be passed as a positional argument.
ID of the associated form field element.
When
True, displays a muted “optional” indicator after the label text.Additional Tailwind CSS classes appended to the component’s built-in styles.
Protocol Reference
Label