Skip to main content

Slider

shadow

Element Slider je interaktívny komponent posuvníka, ktorý umožňuje používateľom praktickým spôsobom vybrať hodnotu z rozsahu hodnôt. Ponúka handle (rukoväť), ktorou možno pohybovať, takže je ideálny pri tých scenároch, ktoré od používateľa vyžadujú číselný vstup alebo úpravu nejakého nastavenia, napríklad hlasitosti.

Základné použitie

V predvolenom nastavení výber umožňuje používateľovi vybrať len jednu možnosť. Zahrnutím elementu Icon sa pri možnosti zobrazí aj zvolená ikona.

Bubble

Pridaním atribútu bubble sa nad sliderom zobrazí bublina s číslom vyjadrujúcim aktuálnu hodnotu posuvníka.

Label

;

Icons

Color

Atribúty a Vlastnosti

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

Eventy

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.

Metódy

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 Vlastnosti

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

Sloty

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.