# Form Element Label

### Key Features

* Supports various form elements.
* Customizable label text.
* Handles required field indicators.
* Compatible with Radix 6 and Bootstrap 5.3.

### Template Structure

The template structure for the form element label is defined in the `form-element--label.twig` file. It includes the following key elements:

* `title`: The label's text.
* `title_display`: Elements title\_display setting.
* `required`: An indicator for whether the associated form element is required.
* `attributes`: A list of HTML attributes for the label.

### Customization

You can customize the form element label by modifying the Twig template or by overriding the default classes and attributes. The following properties are available for customization:

* `title`: Set the label text.
* `title_display`: Control the display of the label (e.g., 'after', 'invisible').
* `required`: Indicate if the form element is required.
* `attributes`: Add custom HTML attributes to the label.

### Usage

To include the form element label in your template, use the following Twig code:

```twig
{% include "radix:form-element--label" with {
  required: true,
  title: "Label",
  title_display: "after",
  attributes: {
    class: "form-label",
  }
} %}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trydrupal.com/radix/components/form-element-label.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
