Progress
The Bootstrap progress
component, implemented in Ruby. Use it like any other matestack component in your apps, pages and components. It offers customizable options to simply achieve what is possible in bootstrap with this component. See below for more information about the possible options.
bs_progress(*args, &block)
bs_progress(*args, &block)
Returns a bootstrap progress containing text or content specified by a block. Also the progress is customizable with the following options.
Optional options
:progress
- expects a number or a list containing hashes with at least a:value
. Other options are:text
,:class
,:variant
,:striped
,:animated
and:aria_valuenow
.value
- Expects an Interger <= 100. Set the current value of the progress bar with this parameterclass
- adding custom class for progress barvariant
- Specify a variant for the progress. Variant represent bootstraps contextual classes and can have one of the following values::primary, :secondary, :success, :info, :warning, :info, :light, :dark
or your custom contextual class. The default is:primary
striped
- Expectstrue
orfalse
. By default is set asfalse
. Set this parameter to true for striped progress bar styleanimated
- Expectstrue
orfalse
. By default is set asfalse
. Set this parameter to true for animated progress bararia_valuenow
- String for attribute aria-valuenowtext
- Expects a string with the text that should go inside the<progress-bar>
tag.Point of Attention: by using the hash option, your progress bar will have multiple bars (look at example 3)
:text
- Expects a string with the text that should go inside the<progress-bar>
tag.:valuemin
- By default it is set as 0. It describes thearia-valuemin
attribute:valuemax
- By default it is set as 100. It describes thearia-valuemax
attribute:height
- Expects an Integer. Set the height of the progress bar in pixelvariant
- Specify a variant for the progress. Variant represent bootstraps contextual classes and can have one of the following values::primary, :secondary, :success, :info, :warning, :info, :light, :dark
or your custom contextual class. The default is:primary
striped
- Expectstrue
orfalse
. By default is set asfalse
. Set this parameter to true for striped progress bar styleanimated
- Expectstrue
orfalse
. By default is set asfalse
. Set this parameter to true for animated progress barHtml attributes - all w3c confirm html attributes for div's can be set via options and will be added to the surrounding progress div.
Examples
Example 1: Basic example
returns
Example 2: Using striped and animated option
returns
Example 3: Multiple bars
returns
Last updated