CSC Design System next
VueFlavour Vue React Angular TypeScript PrimaryCSC UI ColorsPrimarySecondaryAccentCustom ColorsRedOrangeGreenBluePurplePink
Guides Getting started Customization Data visualization Migration guide Componentsc-accordionc-alertc-autocompletec-badgec-buttonc-button-groupc-cardc-checkboxc-csc-logoc-data-tablec-dividerc-iconc-icon-buttonc-inputc-linkc-listc-loaderc-login-buttonsc-login-cardc-mainc-menuc-messagec-modalc-navigation-buttonc-otp-inputc-pagec-paginationc-popoverc-progress-barc-progress-circlec-radio-groupc-selectc-side-navigationc-sliderc-spinnerc-statusc-stepsc-switchc-tablec-tabsc-tagsc-text-fieldc-toastsc-toolbarc-tooltip

<c-slider>

Examples

Basic
Vue React Angular TypeScript
<template>
  <div>
    <c-slider v-model="volume" label="Volume" />

    <p>Value: {{ volume }} %</p>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const volume = ref(40);
</script>
Ticks
Vue React Angular TypeScript
<template>
  <div>
    <c-slider
      v-model="cores"
      label="CPU cores"
      labels
      max="8"
      min="0"
      segments="8"
      step="1"
      ticks
      unit=""
    />
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const cores = ref(2);
</script>

API reference

<c-slider>

Properties

PropertyAttributeTypeDefaultDescription
ariaLabelInternalaria-label-internalstring''Aria label
disableddisabledbooleanfalseDisable the slider
disableTooltipdisable-tooltipbooleanfalseDisable tooltip
hostIdhost-idstring''Id of the element
hostNamehost-namestring''Id of the element
labellabelstring''Label of the slider
labelslabelsbooleanfalseShow tick labels
maxmaxnumber | string'100'Max value
minminnumber | string'0'Min value
segmentssegmentsnumber | string'10'Segment count
stepstepnumber | string'1'Step
ticksticksbooleanfalseThow ticks
unitunitstring'%'Unit
valuevaluenumber | string'50'Value

Events

EventDetailDescription
changeValuenumber | stringFired on every thumb movement, carrying the new slider value — a number when the current `value` prop is a number, otherwise a string. Also dispatched as `change-value` — bind that name in Vue templates.
inputvoidNative bubbling input event fired on every thumb movement so a plain Vue `v-model` works without the `v-control` directive. No detail.
update:valuenumber | stringv-model contract event fired on every thumb movement, carrying the new slider value — a number when the current `value` prop is a number, otherwise a string.

CSS parts

Style from outside with c-slider::part(name) — parts are the library's only styling customization API.

PartDescription
rootThe outer wrapper containing the label, range input and track
labelThe label element rendered above the slider
ticksThe visible track below the input, carrying the progress fill and tick marks