Skip to content

Slider

A material design slider (supports iOS style).

Usage

Slider: 30.0
vue
<template>
  <Column :gap="20">
    <Column :gap="10">
      <Text>Slider: {{ sliderVal.toFixed(1) }}</Text>
      <Container :width="300">
        <Slider v-model:value="sliderVal" :min="0" :max="100" />
      </Container>
    </Column>
  </Column>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { Column, Text, Slider, Container } from "fluekit";

const sliderVal = ref(30);
</script>

RangeSlider

A material design range slider (supports iOS style).

Usage

RangeSlider: 20.0 - 80.0
vue
<template>
  <Column :gap="20">
    <Column :gap="10">
      <Text>RangeSlider: {{ rangeVal.start.toFixed(1) }} - {{ rangeVal.end.toFixed(1) }}</Text>
      <Container :width="300">
        <RangeSlider v-model:value="rangeVal" :min="0" :max="100" />
      </Container>
    </Column>
  </Column>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { Column, Text, RangeSlider, Container } from "fluekit";

const rangeVal = ref({ start: 20, end: 80 });
</script>

Negative Values

Both Slider and RangeSlider support negative values.

Negative Range Slider (-50 to 50)
Value: 0.0Negative RangeSlider (-100 to -10)
Value: -80.0 - -30.0
vue
<template>
  <Column :gap="20">
    <Text>Negative Range Slider (-50 to 50)</Text>
    <Container :width="300">
      <Slider v-model:value="value1" :min="-50" :max="50" />
    </Container>
    <Text>Value: {{ value1.toFixed(1) }}</Text>

    <Text>Negative RangeSlider (-100 to -10)</Text>
    <Container :width="300">
      <RangeSlider v-model:value="value2" :min="-100" :max="-10" />
    </Container>
    <Text>Value: {{ value2.start.toFixed(1) }} - {{ value2.end.toFixed(1) }}</Text>
  </Column>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { Slider, RangeSlider, Column, Text, Container } from "fluekit";

const value1 = ref(0);
const value2 = ref({ start: -80, end: -30 });
</script>

API (Slider)

Props

NameTypeDefaultDescription
valuenumber-The currently selected value for this slider.
minnumber0The minimum value the user can select.
maxnumber100The maximum value the user can select.
variant'material' | 'ios''ios'The visual style of the slider.
activeColorstring'#007AFF'The color to use for the portion of the slider track that is active.
inactiveColorstring'#E5E5EA'The color for the inactive portion of the slider track.
thumbColorstring'#FFFFFF'The color to use for the thumb.

Events

NameDescription
update:valueEmitted when the value changes.
changeEmitted during a drag when the user is selecting a new value.

Props (RangeSlider)

NameTypeDefaultDescription
value{ start: number, end: number }-The currently selected range values.
minnumber0The minimum value the user can select.
maxnumber100The maximum value the user can select.
variant'material' | 'ios''ios'The visual style of the slider.
activeColorstring'#007AFF'The color to use for the portion of the slider track that is active.
inactiveColorstring'#E5E5EA'The color for the inactive portion of the slider track.
thumbColorstring'#FFFFFF'The color to use for the thumb.

Events (RangeSlider)

NameDescription
update:valueEmitted when the range value changes.
changeEmitted during a drag when the user is selecting a new range.