Slider

Slider

Angular 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 Angular Bootstrap slider use:

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

Examples

Slider example.

image info

html
<CDBSlider style="max-width: 300px;margin: auto;"></CDBSlider>
<CDBSlider variant='slider-warning' tooltipPlacement="bottom"
style="max-width: 300px;margin: auto; margin-top: 50px;">
</CDBSlider>
<CDBSlider tooltip="auto" style="max-width: 300px;margin: auto; margin-top: 50px;"></CDBSlider>

API

Here in this section you will find information about required modules and available inputs, outputs, methods and events of this component.

Angular Bootstrap Slider Modules used

import {SliderModule } from 'cdbangular';

API Reference: Contrast Slider Inputs

The table below shows the possible input of the Slider component.

NameTypeDefaultDescriptionExample
classStringAdds custom classesclass="myClass"
valueNumber or StringSlider's value - useful for additional data binding and edge use-casesvalue=49
disableBooleanfalseDisables Slider component[disabled] = false
minNumber0Sets the lowest Slider's valuemin=10
maxNumber100Sets the highest Slider's valuemax=70
stepNumber1Specifies the interval between valid values in a number-based input.step=0.1
sizeStringChanges size of slider component. Choose from lg and smsize="sm"
variantStringdarkChanges default slider color; available values: [blue, red, teal, dark-grey, dark, blue-grey, amber, purple]variant="red"
onChangefunctionReturns slider value, on onChange eventonChange=handleChange
onAfterChangefunctionexecutes a function after Change eventonAfterChange=handleAfterChange
tooltipStringDisplays the current value of the slider. Can choose from auto, on or offtooltip="on"
tooltipPlacementStringSelects where to place tooltip. Can choose from top or bottomtooltipPlacement="top"
tooltipLabelfunctionSets the label of the tooltiptooltipLabel=yourFunction
tooltipStyleObjectCustomize the style of the tooltiptooltipStyle= color: "red"