Skip to main content
Labels provide accessible text descriptions for form fields.

Basic Usage

Labels can contain text directly or wrap other components.

With Form Fields

Labels are typically paired with inputs and other form controls:

API Reference

Label Parameters

text
str | None
default:"None"
Label text content. Can be passed as a positional argument.
for_id
str | None
default:"None"
ID of the associated form field element.
css_class
str | None
default:"None"
Additional Tailwind CSS classes appended to the component’s built-in styles.

Protocol Reference

Label
{
  "type": "Label",
  "children?": "[Component]",
  "text?": "string",
  "forId?": "string",
  "cssClass?": "string"
}
For the complete protocol schema, see Label.