HueSlider

HueSlider is a component used to allow the user to select a color hue.

Usage

import { HueSlider } from "@yamada-ui/react"
<HueSlider.Root />

Change Size

Set Default Value

To set a default value, set a value to defaultValue.

Set Min and Max Values

To set minimum and maximum values, set numbers to min or max.

Change Orientation

To change the orientation, set orientation to "vertical" or "horizontal". By default, "horizontal" is set.

Change Shape

Set Step Value

To set a step value, set a value to step.

Disable

To disable, set disabled to true.

Read-Only

To make read-only, set readOnly to true.

Display Tooltip

Handle Start and End Events

To handle start and end events, use onChangeStart or onChangeEnd.

Value: 180, Start Value: 180, End Value: 180

Control

Props

Accessibility

The HueSlider follows the WAI-ARIA - Slider Pattern for accessibility.

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

ComponentRole and AttributesUsage
HueSlider.Thumbrole="slider"Indicates that this is a slider.
aria-labelSets "Slider thumb".
aria-labelledbySets the id of the associated HueSlider.Root.
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 360.
aria-valuenowSets the current value.
aria-valuetextSets the current value, such as "18°, Red".
aria-describedbyIf HueSlider.Thumb is within a Field.Root and Field.Root has an errorMessage, helperMessage, or a Field.ErrorMessage, Field.HelperMessage, sets its id.
aria-readonlySet to "true" if readOnly is set.
aria-disabledSet to "true" if disabled is set.
aria-invalidSet to "true" if invalid is set.
aria-requiredSet to "true" if required is set.
SliderInputtype="hidden"Excludes the element from the accessibility tree.
aria-describedbyIf HueSlider.Root is within a Field.Root and Field.Root has an errorMessage, helperMessage, or a Field.ErrorMessage, Field.HelperMessage, sets its id.
aria-readonlySet to "true" if readOnly is set.
aria-disabledSet to "true" if disabled is set.
aria-invalidSet to "true" if invalid is set.
aria-requiredSet to "true" if required is set.