Slider
A slider to select a value or range from a given range
Examples
Base
Show code
Sizes
Show code
Variants
Show code
Customise
Show code
Tick and label
Show code
Range
Show code
Class props
Slider component
A slider to select a value or range from a given range
html
<o-slider></o-slider>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
ariaLabel | Accessibility aria-label to to be passed to the slider thumb element. | string | string[] | - | From config: slider: { |
biggerSliderFocus | Increases slider size on focus | boolean | - | false |
customFormatter | Function to format the tooltip label for display | func | - | |
disabled | Slider will be disabled | boolean | - | false |
format | Define v-model format | string | row , percent | From config: slider: { |
indicator | Show indicators | boolean | - | false |
lazy | Update v-model only when dragging is finished | boolean | - | false |
locale | Date format locale | string | string[] | - | From config: { |
max | Maximum value | number | - | 100 |
min | Minimum value | number | - | 0 |
override | Override existing theme classes completely | boolean | - | |
rounded | Rounded thumb | boolean | - | From config: slider: { |
size | Vertical size of slider | string | small , medium , large | From config: slider: { |
step | Step interval of ticks | number | - | 1 |
ticks | Show tick marks | boolean | - | false |
tooltip | Show tooltip when thumb is being dragged | boolean | - | From config: slider: { |
tooltipAlways | Tooltip displays always | boolean | - | false |
tooltipVariant | Color of the tooltip | string | primary , info , success , warning , danger , and any other custom color | From config: slider: { |
v-model | number | number[] | - | 0 | |
variant | Color of the slider | string | primary , info , success , warning , danger , and any other custom color | From config: slider: { |
Events
Event name | Properties | Description |
---|---|---|
update:modelValue | value number | number[] - updated modelValue prop | modelValue prop two-way binding |
change | value number | number[] - updated modelValue prop | on value change event |
dragging | value number | number[] - updated modelValue prop | on dragging event |
dragstart | on drag start event | |
dragend | on drag end event |
Slots
Name | Description | Bindings |
---|---|---|
default | Define additional slider ticks here |
SliderTick component
html
<o-slider-tick></o-slider-tick>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
label | Tick label | string | - | |
override | Override existing theme classes completely | boolean | - | |
value | Value of single tick | number | - |
|
Slots
Name | Description | Bindings |
---|---|---|
default | Override tick content, default is label prop |
Sass variables
Current theme ➜ Oruga Base
SASS Variable | Default |
---|---|
$slider-background | transparent |
$slider-margin | 1em 0 |
$slider-mark-size | 0.75rem |
$slider-font-size | $base-font-size |
$slider-rounded-borded-radius | $base-rounded-border-radius |
$slider-thumb-background | $white |
$slider-thumb-border | 1px solid $grey-light |
$slider-thumb-radius | $base-border-radius |
$slider-thumb-shadow | none |
$slider-thumb-to-track-ratio | 2 |
$slider-thumb-transform | scale(1.25) |
$slider-tick-background | $primary |
$slider-tick-radius | $base-border-radius |
$slider-tick-to-track-ratio | 0.5 |
$slider-tick-width | 3px |
$slider-track-background | $grey-lighter |
$slider-fill-background | $primary |
$slider-track-border-radius | $base-border-radius |
$slider-track-border | 0px solid $grey |
$slider-track-disabled | 0.5 |
$slider-track-radius | $base-border-radius |
$slider-track-shadow | 0px 0px 0px $grey |
See ➜ 📄 Full scss file
Current theme ➜ Oruga Full
SASS Variable | Default |
---|---|
$slider-background | transparent |
$slider-margin | 1em 0 |
$slider-mark-size | 0.75rem |
$slider-font-size | $base-font-size |
$slider-rounded-borded-radius | $base-rounded-border-radius |
$slider-thumb-background | $white |
$slider-thumb-border | 1px solid $grey-light |
$slider-thumb-radius | $base-border-radius |
$slider-thumb-shadow | none |
$slider-thumb-to-track-ratio | 2 |
$slider-thumb-transform | scale(1.25) |
$slider-tick-background | $primary |
$slider-tick-radius | $base-border-radius |
$slider-tick-to-track-ratio | 0.5 |
$slider-tick-width | 3px |
$slider-track-background | $grey-lighter |
$slider-fill-background | $primary |
$slider-track-border-radius | $base-border-radius |
$slider-track-border | 0px solid $grey |
$slider-track-disabled | 0.5 |
$slider-track-radius | $base-border-radius |
$slider-track-shadow | 0px 0px 0px $grey |
See ➜ 📄 Full scss file
Current theme ➜ Bulma
The theme does not have any custom variables for this component.
Current theme ➜ Bootstrap
SASS Variable | Default |
---|---|
$slider-tick-width | 0.25rem |
$slider-tick-height | 0.25rem |
$slider-tick-radius | 50% |
$slider-tick-bg | var(--#{$prefix}gray) |
See ➜ 📄 Full scss file