Sign in


Sign up


Bootstrap Slider

Bootstrap slider is an interactive component that lets the user swiftly slide through possible values spread on the desired range.

Its basic implementation is quite simple and does not require big blocks of code.

Examples of Bootstrap slider use:

  • Video progress bar
  • Volume increase/decrease
  • Enthusiasm-o-meter

See the following Bootstrap slider examples:

Info notification

If you were looking for a slider and you meant a carousel component, click here to see all the possibilities.


Basic slider MDB Pro component

                
<form class="range-field">
    <input type="range" min="0" max="100" />
</form>   
                
            

Slider with price counter MDB Pro component

Slide to see the pricing change


You earn

75$

Client pays

319$

                
input[type=range].no-border {
  border: none; }
                
            
                
var slider = $("#calculatorSlider");
var developerBtn = $("#developerBtn");
var corporateBtn = $("#corporateBtn");
var privateBtn = $("#privateBtn");
var reseller = $("#resellerEarnings");
var client = $("#clientPrice");
var percentageBonus = 30; // = 30%
var license = {
    corpo: {
        active: true,
        price: 319,
    },
    dev: {
        active: false,
        price: 149,
    },
    priv: {
        active: false,
        price: 79,
    }
}

function calculate(price, value) {
    client.text((Math.round((price - (value / 100 * price)))) + '$');
    reseller.text((Math.round(((percentageBonus - value) / 100 * price))) + '$')
}

function reset(price) {
    slider.val(0);
    client.text(price + '$');
    reseller.text((Math.round((percentageBonus / 100 * price))) + '$');
}
developerBtn.on('click', function(e) {
    license.dev.active = true;
    license.corpo.active = false;
    license.priv.active = false;
    reset(license.dev.price)
});
privateBtn.on('click', function(e) {
    license.dev.active = false;
    license.corpo.active = false;
    license.priv.active = true;
    reset(license.priv.price);
});
corporateBtn.on('click', function(e) {
    license.dev.active = false;
    license.corpo.active = true;
    license.priv.active = false;
    reset(license.corpo.price);
});
slider.on("input change", function(e) {
    if (license.priv.active) {
        calculate(license.priv.price, $(this).val());
    } else if (license.corpo.active) {
        calculate(license.corpo.price, $(this).val());
    } else if (license.dev.active) {
        calculate(license.dev.price, $(this).val());
    }
})
                
            
                
<div class="card">
    <div class="card-body">
        
        <h3 class="text-center font-bold blue-text mt-3 mb-4 pb-4"><strong>Slide to see the pricing change</strong></h3>
        <hr>

        <form class="range-field my-5">
            <input id="calculatorSlider" class="no-border" type="range" value="0" min="0" max="30" />
        </form>

        <!-- Grid row -->
        <div class="row">
        
            <!-- Grid column -->
            <div class="col-md-6 text-center pb-5">
        
                <h2><span class="badge blue lighten-2 mb-4">You earn</span></h2>
                <h2 class="display-4" style="color:#0d47a1"><strong id="resellerEarnings">75$</strong></h2>
        
            </div>
            <!-- Grid column -->
        
            <!-- Grid column -->
            <div class="col-md-6 text-center pb-5">
            
                <h2><span class="badge blue lighten-2 mb-4">Client pays</span></h2>
                <h2 class="display-4" style="color:#0d47a1"><strong id="clientPrice">319$</strong></h2>
        
            </div>
            <!-- Grid column -->
        
        </div>
        <!-- Grid row -->

    </div>
</div>
                
            

Slider with different width MDB Pro component

                
<form class="range-field my-4 w-25">
    <input type="range" min="0" max="100" />
</form>

<form class="range-field my-4 w-50">
    <input type="range" min="0" max="100" />
</form>

<form class="range-field my-4 w-75">
    <input type="range" min="0" max="100" />
</form>

<form class="range-field my-4 w-100">
    <input type="range" min="0" max="100" />
</form>
                
            

Slider with first and last value MDB Pro component

0
100
0
100
0
100
                
input[type=range].no-border {
  border: none; }
                
            
                
<div class="card indigo lighten-5">
    <div class="card-body">
        
        <div class="d-flex justify-content-center my-4">
            <span class="font-bold indigo-text mr-2">0</span>
                <form class="range-field w-25">
                    <input class="no-border" type="range" min="0" max="100" />
                </form>
            <span class="font-bold indigo-text ml-2">100</span>
        </div>

        <div class="d-flex justify-content-center my-4">
            <span class="font-bold blue-text mr-2">0</span>
                <form class="range-field w-50">
                    <input class="no-border" type="range" min="0" max="100" />
                </form>
            <span class="font-bold blue-text ml-2">100</span>
        </div>

        <div class="d-flex justify-content-center my-4">
            <span class="font-bold purple-text mr-2">0</span>
                <form class="range-field w-75">
                    <input class="no-border" type="range" min="0" max="100" />
                </form>
            <span class="font-bold purple-text ml-2">100</span>
        </div>

    </div>
</div>
                
            

Slider with icons within card MDB Pro component

Card image cap

Choose your slider option

                
input[type=range].no-border {
  border: none; }
                
            
                
<div class="card blue-grey lighten-5">

        <!--Card image-->
        <img class="img-fluid" src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20%282%29.jpg" alt="Card image cap">

        <div class="card-body text-center">

            <h3 class="indigo-text mt-4"><strong>Choose your slider option</strong></h3>

            <div class="d-flex justify-content-center mb-4 mt-4 pt-3">
                <span class="font-bold blue-text mr-2"><i class="fa fa-thumbs-o-down" aria-hidden="true"></i></span>
                    <form class="range-field w-75">
                        <input class="no-border" type="range" min="0" max="100" />
                    </form>
                <span class="font-bold blue-text ml-2"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i></span>
            </div>

            <div class="d-flex justify-content-center mb-4 mt-4 pt-3">
                <span class="font-bold indigo-text mr-2"><i class="fa fa-dollar" aria-hidden="true"></i></span>
                    <form class="range-field w-75">
                        <input class="no-border" type="range" min="0" max="100" />
                    </form>
                <span class="font-bold indigo-text ml-2"><i class="fa fa-eur" aria-hidden="true"></i></span>
            </div>

            <div class="d-flex justify-content-center mb-4 mt-4 pt-3">
                <span class="font-bold purple-text mr-2"><i class="fa fa-minus" aria-hidden="true"></i></span>
                    <form class="range-field w-75">
                        <input class="no-border" type="range" min="0" max="100" />
                    </form>
                <span class="font-bold purple-text ml-2"><i class="fa fa-plus" aria-hidden="true"></i></span>
            </div>

        </div>
    </div>