AlphaSlider

AlphaSlider is a component used to allow the user to select color transparency.

Usage

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

Change Size

Set Default Value

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

Set Minimum and Maximum 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". The default is "vertical".

Change Shape

Set Step Value

To set the 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 Change Events

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

Value: 0.5, Start Value: 0.5, End Value: 0.5

Control

Props

Accessibility

The AlphaSlider 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

ComponentRoles and AttributesUsage
AlphaSlider.Thumbrole="slider"Indicates that this is a slider.
aria-labelSets "Slider thumb".
aria-labelledbySets the id of the related AlphaSlider.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 1.
aria-valuenowSets the current value.
aria-valuetextSets the current value, such as "18%".
aria-describedbyIf AlphaSlider.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.
SliderInputaria-hiddenExcludes the element from the accessibility tree.
aria-describedbyIf AlphaSlider.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.