Skip to content

Range API Reference

Props

PropTypeDefaultDescription
modelValueArray[0, 0]v-model binding value for the range
valueArray[0, 0]Alternative to modelValue
disabledBooleanfalseDisables the range input
readonlyBooleanfalseMakes the range input read-only
stepNumber0.1Step increment for the range values
variantString'default'Visual variant class (e.g. 'default', 'success')
labelString''Label text for the range input
minNumber0Minimum value of the range
maxNumber100Maximum value of the range
thumbLabelString/BooleanfalseControls thumb label visibility. Options: 'always', true (show on drag/focus), false
thumbLabelClassesArray[]Additional classes for thumb labels
labelClassesArray[]Additional classes for the main label

Events

EventPayloadDescription
update:modelValueArrayEmitted when range values change
changeArrayEmitted when range values change with additional context

Slots

SlotPropsDescription
label-Custom label content

Accessibility

The component implements the following accessibility features:

  • ARIA attributes for screen readers
  • Keyboard navigation support (arrow keys)
  • Focus management
  • Proper role attributes

Example Usage

Basic Usage

vue
<template>
  <ORange
    v-model="rangeValues"
    :min="0"
    :max="100"
    :step="1"
    label="Price Range"
    variant="default"
  />
</template>

<script setup>
import { ref } from "vue";
import { ORange } from "your-component-library";

const rangeValues = ref([20, 80]);
</script>

With Custom Label

vue
<template>
  <ORange v-model="rangeValues" :min="0" :max="1000" :step="10">
    <template #label>
      <div class="custom-label">
        <span>Price Range</span>
        <small>Select your budget</small>
      </div>
    </template>
  </ORange>
</template>

<script setup>
import { ref } from "vue";
import { ORange } from "your-component-library";

const rangeValues = ref([200, 800]);
</script>

With Always Visible Thumb Labels

vue
<template>
  <ORange
    v-model="rangeValues"
    :min="0"
    :max="24"
    :step="1"
    thumbLabel="always"
    label="Time Range"
  />
</template>

<script setup>
import { ref } from "vue";
import { ORange } from "your-component-library";

const rangeValues = ref([9, 17]);
</script>