# Label

> Form label with an optional required indicator, accessibly linked to its control.

## Playground

An interactive playground for Label is embedded above. Open the canonical story on Storybook: [https://storybook.laioutr.cloud/?path=/story/ui-kit-atoms-label--small](https://storybook.laioutr.cloud/?path=/story/ui-kit-atoms-label--small)

## Overview

Label displays a form label and an optional required indicator, linked to its control via `for` so screen readers and click-to-focus work as expected. Most forms get labels for free through `<LField>`; reach for Label directly when you need a label outside a Field (e.g. above a custom composite control).

## Key Business & UX Benefits

- Explicit `for` association makes labels click-to-focus targets, expanding the tap area on mobile and lifting form completion on small screens.
- A single label primitive keeps required indicators and typography consistent across the product, so users learn the visual language once.
- Pairing with `<LField>` covers most forms automatically; the standalone control is there for the edge cases without forcing a fork of the styling.

### Different sizes

#### Example: Label Medium

Live preview: [https://storybook.laioutr.cloud/?path=/story/ui-kit-atoms-label--medium](https://storybook.laioutr.cloud/?path=/story/ui-kit-atoms-label--medium)

```vue-template
<LLabel size="m">First name</LLabel>
```

### With required mark

#### Example: Label Small Required

Live preview: [https://storybook.laioutr.cloud/?path=/story/ui-kit-atoms-label--required-small](https://storybook.laioutr.cloud/?path=/story/ui-kit-atoms-label--required-small)

```vue-template
<LLabel size="s" required>First name</LLabel>
```

#### Example: Label Medium Required

Live preview: [https://storybook.laioutr.cloud/?path=/story/ui-kit-atoms-label--required-medium](https://storybook.laioutr.cloud/?path=/story/ui-kit-atoms-label--required-medium)

```vue-template
<LLabel size="m" required>First name</LLabel>
```

## Feature List

<features :items="["Two sizes ('s', 'm', default 's') match the Input and Field typography scale","`required` boolean appends a `*` indicator with its own `.label__required` styling hook","`forId` prop sets the `for` attribute, so click-to-focus works as a wider tap target on mobile","Reads `<LField>` `disabled` and `invalid` state, adding `label--disabled` and `label--invalid` modifier classes","Renders a semantic `<label>`, so screen readers announce the association automatically","Used inside `<LField>` for most forms; reach for it directly when labelling custom composite controls"]">



</features>

## API Reference

#### Props

```json
{"type":"object","properties":{"required":{"description":"Whether the label's corresponding input is required or not.","type":"boolean","default":false},"disabled":{"type":"boolean"},"invalid":{"type":"boolean"},"size":{"description":"The label's font size.","enum":["s","m"],"type":"string","default":"s"},"forId":{"description":"The id of the element that the label is for.","type":"string","default":"void 0"}}}
```

#### Slots

```json
[{"name":"default","type":"any","description":"","schema":"any"}]
```
