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 | - | From config: slider: { | ||
biggerSliderFocus | - | false | ||
disabled | - | false | ||
format | - | From config: slider: { | ||
formatter | - | |||
indicator | - | false | ||
lazy | - | false | ||
locale | - | From config: { | ||
max | - | 100 | ||
min | - | 0 | ||
v-model | - | |||
override | - | |||
rounded | - | From config: slider: { | ||
size | - | From config: slider: { | ||
step | - | 1 | ||
ticks | - | false | ||
tooltip | - | From config: slider: { | ||
tooltipAlways | - | false | ||
tooltipVariant | - | From config: slider: { | ||
variant | - | 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
SASS Variable | Default |
---|---|
$slider-background | transparent |
$slider-margin | 1em 0 |
$slider-mark-size | 0.75rem |
$slider-font-size | var(--#{$prefix}base-font-size) |
$slider-rounded-borded-radius | var( --#{$prefix}base-border-radius-rounded) |
$slider-thumb-background | var(--#{$prefix}white) |
$slider-thumb-border | 1px solid var(--#{$prefix}grey-light) |
$slider-thumb-radius | var(--#{$prefix}base-border-radius) |
$slider-thumb-shadow | none |
$slider-thumb-to-track-ratio | 2 |
$slider-thumb-transform | scale(1.25) |
$slider-tick-background | var(--#{$prefix}primary) |
$slider-tick-radius | var(--#{$prefix}base-border-radius) |
$slider-tick-to-track-ratio | 0.5 |
$slider-tick-width | 3px |
$slider-track-background | var(--#{$prefix}grey-lighter) |
$slider-fill-background | var(--#{$prefix}primary) |
$slider-track-border-radius | var(--#{$prefix}base-border-radius) |
$slider-track-border | 0px solid var(--#{$prefix}grey) |
$slider-track-disabled | 0.5 |
$slider-track-radius | var(--#{$prefix}base-border-radius) |
$slider-track-shadow | 0px 0px 0px var(--#{$prefix}grey) |
See ➜ 📄 Full scss file
Current theme ➜ Bulma
SASS Variable | Default |
---|---|
$slider-colors | var.$colors |
$slider-radius | css.getVar("radius") |
$slider-background | css.getVar("grey-lighter") |
$slider-color | css.getVar("primary") |
$slider-track-border | 0px solid css.getVar("grey") |
$slider-track-shadow | 0px 0px 0px css.getVar("grey") |
$slider-thumb-background | css.getVar("scheme-main") |
$slider-thumb-radius | css.getVar("radius") |
$slider-thumb-border | 1px solid css.getVar("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 | css.getVar("radius") |
$slider-tick-background | css.getVar("grey-light") |
$slider-tick-label-size | 0.75rem |
See ➜ 📄 Full scss file
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