# `m-field`

A field label is a text element that identifies the purpose of an input field, providing users with clear guidance on what information to enter. It is typically placed above the input field and may include indicators for required or optional fields. Field Labels improve form usability, accessibility, and data entry accuracy by ensuring users understand the expected input.

## Props

| Name | Description | Type | Default |
|------|-------------|------|---------|
| `id*` | A unique identifier for the form field, used to associate the label with the form element. | `string` |   |
| `label*` | The text displayed as the label for the form field. | `string` |   |
| `requirementtext` | Additional text displayed alongside the label, typically used to indicate if the form field is required or optional | `string` |   |
| `helptext` | Text shown below the form field to provide additional context or instructions for the user. | `string` |   |
| `helpid` | The value of the `id` attribute set on the **helpText** element. _This value is mandatory when using a helpText in order to guarantee the accessibility of the component._ | `string` |   |
| `isvalid` | If `true`, applies a valid state to the form field. | `boolean` |   |
| `isinvalid` | If `true`, applies an invalid state to the form field. | `boolean` |   |
| `isloading` | If `true`, applies a loading state to the form field. | `boolean` |   |
| `messageid` | The value of the `id` attribute set on the **validationMessage** element. _This value is mandatory when using a validationMessage in order to guarantee the accessibility of the component._ | `string` |   |
| `message` | message displayed when the form field has a valid or invalid state, usually indicating validation or errors. | `string` |   |

## Slots

| Name | Description |
|------|-------------|
| `default` | Use this slot to insert the form element of your choice |

