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

Component and ElementRoles and AttributesUsage
AlphaSlider.Thumbrole="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 1.
aria-valuenowSets the current value.
aria-valuetextSets the current value, such as "18%".
aria-describedbyIf this 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.
inputaria-hiddenExcludes the element from the accessibility tree.
aria-describedbyIf this 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.

Similar Components

HueSlider

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

SaturationSlider

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

ColorSelector

ColorSelector is a component used by the user to select a color.

Slider

Slider is a component used for allowing users to select a value from a range.

ColorPicker

ColorPicker is a component used by the user to select a color or enter an arbitrary color value.

Uses Components & Hooks

Used By Components & Hooks