Skip to main content

Slider

shadow

Element Slider is an interactive slider component that allows users to select a value from a range of values in a convenient way. It features a handle that can be moved, making it ideal for those scenarios that require the user to provide numeric input or adjust some setting such as volume.

Basic usage

By default, the selection allows the user to select only one option. Including the Icon element will also display the selected icon next to the option.

Bubble

Adding the bubble attribute will display a bubble above the slider with a number representing the current value of the slider.

Label

;

Icons

Color

Attributes and Properties

value

DescriptionThe current value of the slider.
Attributevalue
Typenumber
Default0

min

DescriptionMinimum slider value.
Attributemin
Typenumber
Default0

max

DescriptionThe maximum value of the slider.
Attributemax
Typenumber
Default100

step

DescriptionStep value - determines how much the value will change in one shift.
Attributestep
Typenumber
Default1

bubble

DescriptionIf defined, a bubble with the current value is displayed above the slider.
Attributebubble
Typeboolean
Defaultfalse

color

DescriptionThe colour of the slider to be used. The default options are "primary", "success", "warning", "danger", "complete", and "dark".
Attributecolor
Type"complete" | "danger" | "dark" | "primary" | "success" | "warning" | string
Defaultundefined

Events

NameDescription
wje-slider:initCalled when the slider is initialized.
wje-slider:moveCalled when the slider moves.
wje-slider:changeCalled when the value of the slider changes.

Methods

getPercentage

DescriptionCalculates the percentage value within the given range.
SignaturegetPercentage(min: number, max: number, value?: number) => number

CSS Shadow Parts

NameDescription
nativeRefers to the main enveloping div element.
sliderRefers to the input element of the range type.

CSS Custom Properties

NameDescription
--wje-slider-track-heightSlider track height
--wje-slider-colorColour of the active part of the slider track
--wje-slider-thumb-colorSlider button colour
--wje-slider-thumb-borderThe edge of the slider button
--wje-slider-thumb-shadowShadow of the slider button in the basic state
--wje-slider-thumb-shadow-activeShadow of the slider button in active state
--wje-slider-track-colorColour of the inactive part of the slider track

Slots

NameDescription
labelThe contents of the slider nameplate.
startThe content that appears at the beginning of the slider.
endThe content that appears at the end of the slider.