Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMark Otto <markd.otto@gmail.com>2018-02-20 01:40:59 +0300
committerGitHub <noreply@github.com>2018-02-20 01:40:59 +0300
commit470b4472c63f444851c2bc5b7e6cf838103a621a (patch)
tree1cbeb2cd2f2f8b1ea500b978e984f45789a1ab47 /docs
parent3dd0bde664699fc7a191d0d3569f4f0ba8f06028 (diff)
Custom range input (#25600)
* added the styling * added the documentation * update for one rule per line * fix hound error: trailing whitespace * trimmed off vendor prefixes * Add note about track and thumb * Psuedo-elements must be split across multiple rulesets to have an affect * Fix firefox inner focus * Seems that FF is the only one affected by this * Add support for gradients * Add labels, clarify min/max changes * add step example * add custom range vars
Diffstat (limited to 'docs')
-rw-r--r--docs/4.0/components/forms.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/4.0/components/forms.md b/docs/4.0/components/forms.md
index 07063854d5..8bf61de35d 100644
--- a/docs/4.0/components/forms.md
+++ b/docs/4.0/components/forms.md
@@ -1172,6 +1172,29 @@ As is the `size` attribute:
</select>
{% endexample %}
+### Range
+
+Create custom `<input type="range">` controls with `.custom-range`. The track (the background) and thumb (the value) are both styled to appear the same across browsers. As only IE and Firefox support "filling" their track from the left or right of the thumb as a means to visually indicate progress, we do not currently support it.
+
+{% example html %}
+<label for="customRange1">Example range</label>
+<input type="range" class="custom-range" id="customRange1">
+{% endexample %}
+
+Range inputs have implicit values for `min` and `max`—`0` and `100`, respectively. You may specify new values for those using the `min` and `max` attributes.
+
+{% example html %}
+<label for="customRange2">Example range</label>
+<input type="range" class="custom-range" min="0" max="5" id="customRange2">
+{% endexample %}
+
+By default, range inputs "snap" to integer values. To change this, you can specify a `step` value. In the example below, we double the number of steps by using `step="0.5"`.
+
+{% example html %}
+<label for="customRange3">Example range</label>
+<input type="range" class="custom-range" min="0" max="5" step="0.5" id="customRange3">
+{% endexample %}
+
### File browser
The file input is the most gnarly of the bunch and requires additional JavaScript if you'd like to hook them up with functional *Choose file...* and selected file name text.