Skip to content

ChannelSlider

ChannelSlider provides the same Root/Track/Thumb composition and keyboard behavior as Reka's Slider while accepting an arbitrary scalar channel. OpenPencil uses it only for OkHCL channels; standard RGB, HSL, and HSB controls should use Reka ColorSlider directly.

Fill swatches

Fill state

OkHCL channel

16%

Anatomy

  • ChannelSliderRoot — controlled value, range, step, orientation, and accessible channel label
  • ChannelSliderTrack — polymorphic track element
  • ChannelSliderThumb — slider thumb with range ARIA and formatted value text

Arrow keys step the value. Page Up and Page Down use larger steps, while Home and End move to the range boundaries. The primitive is temporary until Reka issue #2798 provides first-class OkHCL support.

vue
<script setup lang="ts">
import { 
ref
} from 'vue'
import {
ChannelSliderRoot
,
ChannelSliderThumb
,
ChannelSliderTrack
} from '@open-pencil/vue' const
chroma
=
ref
(0.16)
</script> <template> <
ChannelSliderRoot
v-model
="
chroma
"
label
="Chroma"
:min
="0"
:max
="0.4"
:step
="0.001">
<
ChannelSliderTrack
/>
<
ChannelSliderThumb
/>
</ChannelSliderRoot> </template>

Generated API reference

ChannelSliderRoot

Generated from packages/vue/src/primitives/ChannelSlider/ChannelSliderRoot.vue

Props

PropDefaultType
modelValue*
Controlled channel value.
number
label*
Accessible channel name announced by the thumb.
string
min
Minimum channel value.
0number | undefined
max
Maximum channel value.
100number | undefined
step
Channel increment.
1number | undefined
orientation
Slider orientation.
"horizontal"ChannelSliderOrientation | undefined
disabled
Prevents pointer and keyboard interaction.
falseboolean | undefined
inverted
Reverses the visual direction of the slider.
falseboolean | undefined
formatValueText
Formats the value announced by assistive technology.
String((value: number) => string) | undefined
asChild
Change the default rendered element for the one passed as a child, merging their props and behavior. Read our [Composition](https://www.reka-ui.com/docs/guides/composition) guide for more details.
falseboolean | undefined
as
The element or component this component should render as. Can be overwritten by `asChild`.
"span"AsTag | Component | undefined

Events

EventPayloadDescription
update:modelValue[value: number]
valueCommit[value: number]

Slots

SlotPropsDescription
defaultChannelSliderRootSlotProps

ChannelSliderTrack

Generated from packages/vue/src/primitives/ChannelSlider/ChannelSliderTrack.vue

Props

PropDefaultType
asChild
Change the default rendered element for the one passed as a child, merging their props and behavior. Read our [Composition](https://www.reka-ui.com/docs/guides/composition) guide for more details.
falseboolean | undefined
as
The element or component this component should render as. Can be overwritten by `asChild`.
"span"AsTag | Component | undefined

Slots

SlotPropsDescription
default{}

ChannelSliderThumb

Generated from packages/vue/src/primitives/ChannelSlider/ChannelSliderThumb.vue

Props

PropDefaultType
asChild
Change the default rendered element for the one passed as a child, merging their props and behavior. Read our [Composition](https://www.reka-ui.com/docs/guides/composition) guide for more details.
falseboolean | undefined
as
The element or component this component should render as. Can be overwritten by `asChild`.
"span"AsTag | Component | undefined

Slots

SlotPropsDescription
defaultChannelSliderThumbSlotProps

Released under the MIT License.