Skip to main content

Toggle

shadow

Toggle elements are small interactive controls that allow you to switch between two states. You can activate them with a click of the mouse. They are most often used to activate and deactivate functionalities or to switch between showing and hiding other elements.

Basic Usage

Colors

Attributes and Properties

checked

DescriptionAk true, toggle je aktivovaný.
Attributechecked
Typeboolean
Defaultfalse

color

DescriptionFarba, ktorá sa má použiť z palety farieb vašej aplikácie. Predvolené možnosti sú: "primary", "success", "warning", "danger", "complete", a "dark". Pre viac informácií o farbách navštívte Základy prispôsobenia.
Attributecolor
Type"complete" | "danger" | "dark" | "primary" | "success" | "warning" | string | undefined
Defaultundefined

disabled

DescriptionAk true, s toggle elementom nie je možné interagovať.
Attributedisabled
Typeboolean
Defaultfalse

name

DescriptionDefinuje name atribút, ktorý je dôležitý napríklad pri použití vo formulároch.
Attributename
Typestring
Defaultthis.inputId

Events

NameDescription
changeVyvolaný pri zmene stavu elementu.

Methods

No public methods available for this component.

CSS Shadow Parts

NameDescription
inputOdkazuje na input element typu checkbox
toggleOdkazuje na vnútorný div obaľovací element

CSS Custom Properties

NameDescription
--wj-toggle-border-radiusBorder radius of the toggle track
--wj-toggle-color-baseBackground of the toggle handle
--wj-toggle-handle-border-radiusBackground of the toggle handle when checked
--wj-toggle-handle-colorBorder radius of the toggle handle
--wj-toggle-handle-heightBox shadow of the toggle handle
--wj-toggle-handle-shadowHeight of the toggle handle
--wj-toggle-handle-shadow-checkedMaximum height of the toggle handle
--wj-toggle-handle-widthHorizontal spacing around the toggle handle
--wj-toggle-heightTransition of the toggle handle
--wj-toggle-widthWidth of the toggle handle

Slots

NameDescription
``Predvolené umiestnenie obsahu elementu.