bootstrap
  1. bootstrap-range

Bootstrap Range

Bootstrap range is a UI component that allows users to select a value from a range of values using a slider. It is a built-in component in Bootstrap that is easy to use and customize.

Syntax

To create a range slider with Bootstrap, you need to add the following HTML code:

<input type="range" class="form-range" min="0" max="100" id="rangeSlider">

In this code, the type attribute is set to range, the class attribute is set to form-range, the min attribute is set to the minimum value of the range, the max attribute is set to the maximum value of the range, and the id attribute is set to a unique identifier for the range slider.

Example

Here is an example of how to create a range slider with Bootstrap.

<label for="rangeSlider" class="form-label">Range Slider</label>
<input type="range" class="form-range" min="0" max="100" id="rangeSlider">
Try Playground

Explanation

In the code above, we used the following classes and attributes to create the range slider:

  • form-label: this is a class applied to the label for the range slider.
  • form-range: this is a class applied to the range slider input element.
  • min: this attribute specifies the minimum value of the range slider.
  • max: this attribute specifies the maximum value of the range slider.

Use

Bootstrap range can be used in various applications where users need to select a value from a range of values. For example, you can use it in a music player application to allow users to select a track from a playlist.

Important Points

  • Bootstrap range is a built-in UI component in Bootstrap that is easy to use and customize.
  • Bootstrap range uses a slider to allow users to select a value from a range of values.
  • You can customize the minimum and maximum values of the range slider.

Summary

Bootstrap range is a useful UI component that allows users to select values from a range of values using a slider. By using Bootstrap range, you can create an intuitive user interface for your web application.

Published on: