Range

Vue Bootstrap 5 Range

A Range is an interactive component that lets the user swiftly slide through possible values spread over the desired range.

Note: Read the API tab to find all available options and advanced customization


Basic example

The track (the background) and thumb (the value) are both styled to appear the same across browsers. As only Firefox supports “filling” their track from the left or right of the thumb as a means to visually indicate progress, we do not currently support it.


          <template>
            <MDBRange label="Example range" v-model="range1" />
          </template>
        

          <script>
            import { MDBRange } from "mdb-vue-ui-kit";
            import { ref } from "vue";

            export default {
              components: {
                MDBRange
              },
              setup() {
                const range1 = ref(50);

                return {
                  range1
                };
              }
            };
          </script>
        

Disabled

Add the disabled boolean attribute on a component to give it a grayed out appearance and remove pointer events.


          <template>
            <MDBRange label="Example range" disabled />
          </template>
        

          <script>
            import { MDBRange } from "mdb-vue-ui-kit";

            export default {
              components: {
                MDBRange
              }
            };
          </script>
        

Min and max

Range inputs have implicit values for min and max0 and 100, respectively. You may specify new values for those using the min and max attributes.


          <template>
            <MDBRange label="Example range" v-model="range2" :min="0" :max="5" />
          </template>
        

          <script>
            import { MDBRange } from "mdb-vue-ui-kit";
            import { ref } from "vue";

            export default {
              components: {
                MDBRange
              },
              setup() {
                const range2 = ref(3);

                return {
                  range2
                };
              }
            };
          </script>
        

Steps

By default, range inputs “snap” to integer values. To change this, you can specify a step attribute. In the example below, we double the number of steps by using :step="0.5".


          <template>
            <MDBRange label="Example range" v-model="range3" :min="0" :max="5" :step="0.5" />
          </template>
        

          <script>
            import { MDBRange } from "mdb-vue-ui-kit";
            import { ref } from "vue";

            export default {
              components: {
                MDBRange
              },
              setup() {
                const range3 = ref(2.5);

                return {
                  range3
                };
              }
            };
          </script>
        

Import


        import { MDBRange } from "mdb-vue-ui-kit";
      

Properties

Property Type Default Description
disabled Boolean false Disables input
id String unique random id Changes input's id
inputClass String "" Adds input classes
label String "" Changes input label
labelClass String "" Adds input label classes
max Number 100 Sets maximum value
min Number 0 Sets minimum value
step Number 1 Defines range step
tag String "div" Changes input wrapper tag
thumb Boolean true Enables or disables thumb.
thumbClass String "" Adds thumb classes
v-model Number 50 Changes input value with two-way data binding
wrapperClass String "" Adds input wrapper classes