Stepper

Accessibility

PropTypeDescription
ariaLabelValuestringSpecifies aria-label for the input field.
ariaLabelledbystringSpecifies aria-labelledby for the input field, referencing the ID of the element that labels the component, ensuring that screen readers announce the label correctly.
ariaDescribedbystringSpecifies aria-describedby for the input field, referencing the ID of the element that describes the component, providing additional context or instructions.
PropTypeDescription
titleDecrementstringSpecifies aria-label for the decrement icon button.
titleIncrementstringSpecifies aria-label for the increment icon button.
descriptionDecrementstringSpecifies aria-describedby for the decrement icon button, referencing the ID of the descriptive element.
descriptionIncrementstringSpecifies aria-describedby for the increment icon button, referencing the ID of the descriptive element.

Example

<Stepper
step={1}
minValue={0}
minValue={10}
ariaLabelValue="Number of passengers"
titleDecrement="Remove a passenger"
titleIncrement="Add a passenger"
/>
<Stack>
<Stack>
<Text id="passengers">Passengers</Text>
</Stack>
<Stepper
step={1}
minValue={0}
maxValue={10}
ariaLabelValue="Number of passengers"
ariaLabelledby="passengers"
titleDecrement="Remove a passenger"
titleIncrement="Add a passenger"
/>
</Stack>
<Stack>
<Stack>
<Text id="adults-title">Adults</Text>
<Text id="adults-description">Number of adults in your group</Text>
</Stack>
<Stepper
step={1}
minValue={0}
maxValue={10}
ariaLabelValue="Number of passengers"
ariaLabelledby="adults-title"
ariaDescribedby="adults-description"
titleDecrement="Remove a passenger"
titleIncrement="Add a passenger"
descriptionIncrement="adults-title"
descriptionDecrement="adults-title"
/>
</Stack>