Leave Yamada UI a star

Star
Yamada UIYamada UIv1.6.4

RangeSlider

RangeSlider is a component used for users to select a range of related values.

Source@yamada-ui/slider

The RangeSlider follows the WAI-ARIA - Slider (Multi-Thumb) Pattern for accessibility.

If you are not using Fieldset, set aria-label or aria-labelledby to RangeSlider.

<RangeSlider aria-label="Hotel Price Range" />
Copied!
<VStack gap="sm">
<Text as="h3" id="label">
Hotel Price Range
</Text>
<RangeSlider aria-labelledby="label" />
</VStack>
Copied!

For example, if the day of the week is represented by a number and the value of aria-valuenow is not user-friendly, set aria-valuetext to a human-readable string such as "Monday".

const weekday = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
]
return (
<RangeSlider getAriaValueText={(value) => weekday[value]} max={6} min={0} />
)
Copied!

Keyboard Navigation

KeyDescriptionState
ArrowRightIncreases the value based on the step value.-
ArrowLeftDecreases the value based on the step value.-
ArrowUpIncreases the value based on the step value.-
ArrowDownDecreases the value based on the step value.-
HomeSets the value to min.-
EndSets the value to max.-
PageUpIncreases the value based on the min and max values.-
PageDownDecreases the value based on the min and max values.-

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
RangeSliderStartThumb, RangeSliderEndThumbrole="slider"Indicates that this is a slider.
aria-labelSets "Slider thumb".
aria-orientationSets "horizontal" or "vertical" based on the orientation value. Default is "horizontal".
aria-valueminSets the min value. Default is 0.
aria-valuemaxSets the max value. Default is 100.
aria-valuenowSets the current value.
aria-valuetextSets the current value.
aria-readonlySet to "true" if isReadOnly is set.
aria-disabledSet to "true" if isDisabled is set.
aria-invalidSet to "true" if isInvalid is set.
aria-requiredSet to "true" if isRequired is set.
RangeSliderMarkaria-hiddenExcludes the element from the accessibility tree.
input Internaltype="hidden"Excludes the element from the accessibility tree.
aria-readonlySet to "true" if isReadOnly is set.
aria-disabledSet to "true" if isDisabled is set.
aria-invalidSet to "true" if isInvalid is set.
aria-requiredSet to "true" if isRequired is set.

Edit this page on GitHub

PreviousSliderNextHueSlider