SaturationSlider

SaturationSlider is a component used to allow the user to select a color saturation.

Usage

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

Change Size

Set Default Value

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

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: [120,0.33,0.33], Start Value: [120,0.33,0.33], End Value: [120,0.33,0.33]

Control

Props

Accessibility

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

Keyboard Navigation

KeyDescriptionState
ArrowRightIncreases saturation based on the step value.-
ArrowLeftDecreases saturation based on the step value.-
ArrowUpIncreases brightness based on the step value.-
ArrowDownDecreases brightness based on the step value.-

ARIA Roles and Attributes

ComponentRole and AttributesUsage
SaturationSlider.Thumbrole="slider"Indicates that this is a slider.
aria-labelSets "Saturation and brightness thumb".
aria-labelledbySets the id of the related SaturationSlider.Root.
aria-roledescriptionSets "2D slider".
aria-valueminSets 0.
aria-valuemaxSets 100.
aria-valuenowSets the current value.
aria-valuetextSets the current value, such as "Saturation 18%, Brightness 18%".
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.
aria-describedbyIf SaturationSlider.Root is within a Field.Root and Field.Root has an errorMessage, helperMessage, or a Field.ErrorMessage, Field.HelperMessage, sets its id.
inputaria-hiddenExcludes the element from the accessibility tree.
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.
aria-describedbyIf SaturationSlider.Root is within a Field.Root and Field.Root has an errorMessage, helperMessage, or a Field.ErrorMessage, Field.HelperMessage, sets its id.