Skip to content

ESwitch Switch ​

import EUI 1.0

Examples ​

Switch ​

QML sourceQML
Preview
Run the code to try the component

Edit text, properties, or events, then select Run.

Code runs in this browser Licenses

Switch ​

QML sourceQML
Preview
Run the code to try the component

Edit text, properties, or events, then select Run.

Code runs in this browser Licenses

Properties ​

PropertyDescriptionValues and default
accessibleNamestring

Name read by assistive technologies; provide a readable name for controls without text.

Defaulttext
activeColorcolor

Active or selected color.

DefaultDynamic binding
activeIconint

Icon used by the component.

EIcons.*
0 (no icon)

Default0
activeTextstring

Text for the active or inactive state.

Default""
activeValuevar

Value associated with checked or active state.

Defaulttrue
beforeChangevar

Guard before changing switch state, returning a boolean or Promise.

Defaultnull
checkedbool

Whether the control is checked or active.

Defaultfalse
durationint

Animation or display duration in milliseconds; the component binding identifies its use.

Default300
enabledbool

Allow interaction; false disables the control.

Defaulttrue
fontfont

Font settings for the family, size and text style.

Common fields:
family, pixelSize, pointSize
bold, italic, weight
underline, strikeout
letterSpacing, wordSpacing

Defaultapplication font
heightreal

Component size in pixels; may be bound to its parent layout.

DefaultimplicitHeight
inactiveColorcolor

Inactive color.

DefaultDynamic binding
inactiveIconint

Icon used by the component.

EIcons.*
0 (no icon)

Default0
inactiveTextstring

Text for the active or inactive state.

Default""
inactiveValuevar

Value associated with unchecked or inactive state.

Defaultfalse
loadingbool

Whether the component is loading.

Defaultfalse
sizeint

Control size; inherits the nearest EConfigProvider by default.

EStyle.Small
EStyle.Medium
EStyle.Large

DefaultInherited; EStyle.Medium by default
textstring

Displayed text.

Defaultchecked ? activeText : inactiveText
validateEventbool

Request enclosing-form validation when the value changes.

Defaulttrue
valuevar

Current value; read or write through property bindings, with arrays for multiple or range selection.

Defaultundefined
visiblebool

Whether the component is visible.

Defaulttrue
widthreal

Component size in pixels; may be bound to its parent layout.

DefaultimplicitWidth

Signals ​

SignaturePurpose
changeRejected(string message)

Emitted when a state change is rejected; message explains why.

Released under the MIT License. Third-party assets retain their own licenses.