<!--
  GENERATED FILE - do not edit by hand.
  Source of truth: src/components/mds-input-range-value/ in the magma monorepo (usage/*.md and the
  component's JSDoc). Regenerated on every stencil build (scripts/component-docs.ts).
-->

# mds-input-range-value

> `@maggioli-design-system/magma` 2.15.0. Shadow DOM: style it only through the public CSS custom properties and the parts below.

The `<mds-input-range-value>` web component is one value of a [`<mds-input-range>`](../mds-input-range/AGENTS.md) that holds several values on one track, as an `<option>` is one choice of a `<select>`. The range draws a thumb for each of its `<mds-input-range-value>` children; the child itself draws nothing.

#### Semantic Behavior

- **Compound child only**: it works only as a direct child of `<mds-input-range>`. Outside a range it is hidden and does nothing.
- **One child, one thumb**: adding a value is adding a child, removing one is removing its child. The range watches its children, their values and their text.
- **The text names the thumb**: the text of the child is the accessible name of its thumb ("Minimo", "Massimo"), as each thumb of the multi-thumb slider of the WAI-ARIA APG. A child without text gets a name made of the label of the range and its position ("Prezzo, 1 di 2", in the language of the page).
- **The range keeps the value valid**: it brings a value outside `min` and `max`, or off the `step`, inside the range and onto the step, as a native range input does, and writes it back here. A child without a value starts in the middle of the range.
- **The order is the order of the values**: the thumbs follow their values from the lowest, whatever the order of the children in the markup; each keeps the name of its own child.
- **The value follows the thumb**: as the thumb moves, the range writes its value on `value`, which is reflected. Setting `value` moves the thumb.

#### Properties & Visual Configurations

The only prop is `value`, the number of the thumb. The thumb is styled by its range: the child has no `variant` / `tone` ([`agents/variants.md`](../../../../agents/variants.md)), no part and no public CSS custom property.

## Read next

- [`examples.md`](examples.md) - correct usage, from the most common case
- [`mistakes.md`](mistakes.md) - the wrong forms, each with the right one
- [Storybook](https://magma-design-system.github.io/magma/storybook/?path=/docs/ui-forms-range-value--docs) - the live examples, in the published Storybook of `main`
- [`conventions.md`](../../../../agents/conventions.md), [`variants.md`](../../../../agents/variants.md), [`mistakes.md`](../../../../agents/mistakes.md) - the rules shared by every component

## Props

| Prop | Attribute | Type | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `value` | `number \| undefined` | - | The value of the thumb. The range keeps it inside its `min` and `max`, on its `step` and between the values next to it, and writes it here as the thumb moves; set it to move the thumb. Without a value the thumb starts in the middle of the range, as a native range input |

## Slots

| Slot | Description |
| --- | --- |
| (default) | The name of the value, as text ("Minimo", "Massimo"): the accessible name of its thumb. Without text the thumb is named after the label of the range and its position ("Prezzo, 1 di 2") |
