Skip to content

Alpha Slider

A slider control for adjusting the alpha (opacity) channel.

import { AlphaSlider } from '@hueycolor/vue'
<script setup>
import { ref } from 'vue'
import { HueyRoot, AlphaSlider, hueyColor } from '@hueycolor/vue'
const color = ref(hueyColor('#1A3263'))
</script>
<template>
<HueyRoot v-model="color">
<AlphaSlider />
</HueyRoot>
</template>
Prop Type Default Description
orientation 'horizontal' | 'vertical' 'horizontal' The orientation of the slider track.
aria-label string 'Alpha slider' Accessible label for the slider.

Target the track with [huey-slider="alpha"] (or the shared [huey-slider-track]) and its thumb with [huey-slider="alpha"] [huey-slider-thumb]. Use [aria-orientation="vertical"] to style the vertical orientation.

PropertyDefaultDescription
--huey-slider-track-height 16px Track height (or width when vertical)
--huey-slider-track-width 129px Track width (or height when vertical)
--huey-thumb-size var(--huey-slider-track-height, 16px) Size of the thumb

The track background and thumb color are driven dynamically via --huey-slider-bg and --huey-thumb-color.