Use Slider Tick component to add custom ticks and labels
Slider
A slider to select a value or range from a given range
# Sizes
# Types
# Customization
# Tick and label
# Range slider
Just bind the value to an Array.
# Lazy update
Use lazy
to update v-model
only when dragging is finished.
# Indicator
Use indicator
to show v-model
inside the thumb.
# API
Slider
Name | Description | Type | Values | Default |
---|---|---|---|---|
v-model | Binding value | Number, Array | — | — |
min | Minimum value | Number | — | 0 |
max | Maximum value | Number | — | 100 |
step | Step interval of ticks | Number | — | 1 |
type | Type (color) of the slider, optional | String | is-white , is-black , is-light ,
is-dark , is-primary , is-info , is-success ,
is-warning , is-danger ,
and any other colors you've set in the $colors list on Sass | is-primary |
size | Thickness of the slider, optional | String | is-small , is-medium , is-large | — |
ticks | Show tick marks | Boolean | — | false |
tooltip | Show tooltip when thumb is being dragged | Boolean | — | false |
indicator | Show v-model value inside thumb | Boolean | — | true |
tooltip-type | The type (color) of the tooltip. Defaults to type | String | is-white , is-black , is-light ,
is-dark , is-primary , is-info , is-success ,
is-warning , is-danger ,
and any other colors you've set in the $colors list on Sass | type |
rounded | Rounded thumb | Boolean | — | false |
disabled | Disable the slider | Boolean | — | false |
custom-formatter | Function to format the tooltip label for display | Function | — | — |
format | Which format should be used to display the value.
The value will be displayed as-is if using raw . The percent using value ,
min and max will be calculated and displayed if using percent | String | raw , percent | raw |
locale | Accept a string with a BCP 47 language tag, or an array of such strings. See Unicode BCP 47 locale identifier | String, Array of String | — | undefined : default to browser locale. |
aria-label | Accessibility label for the thumbs | String, Array | — | — |
bigger-slider-focus | Increase the clickable area | Boolean | — | false |
tooltip-always | Tooltip displays always | Boolean | — | false |
SliderTick
Name | Description | Type | Values | Default |
---|---|---|---|---|
value | The value that the tick represents | Number | — | — |
# Variables
You can use these variables to customize this component.
Name | Default |
---|---|
$slider-radius | $radius |
$slider-track-background | $grey-lighter |
$slider-track-radius | $radius |
$slider-track-border | 0px solid $grey |
$slider-track-shadow | 0px 0px 0px $grey |
$slider-thumb-background | $scheme-main |
$slider-thumb-radius | $radius |
$slider-thumb-border | 1px solid $grey-light |
$slider-thumb-shadow | none |
$slider-thumb-to-track-ratio | 2 |
$slider-tick-to-track-ratio | 0.5 |
$slider-tick-width | 3px |
$slider-tick-radius | $radius |
$slider-tick-background | $grey-light |
$slider-mark-size | 0.75rem |
$slider-colors | $colors |
This page is open source. Noticed a typo or something's unclear?