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>import { AlphaSlider } from '@hueycolor/svelte'<script>import { HueyRoot, AlphaSlider, hueyColor } from '@hueycolor/svelte'
let color = $state(hueyColor('#1A3263'))</script>
<HueyRoot bind:color> <AlphaSlider /></HueyRoot>| Prop | Type | Default | Description |
|---|---|---|---|
orientation | 'horizontal' | 'vertical' | 'horizontal' | The orientation of the slider track. |
aria-label | string | 'Alpha slider' | Accessible label for the slider. |
Styling
Section titled “Styling”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.
| Property | Default | Description |
|---|---|---|
--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.