Skip to main content

Toggle

A toggle represents a physical switch that allows someone to choose between two mutually exclusive options. For example, "On/Off", "Show/Hide". Choosing an option should produce an immediate result.

Examples​

Properties​

NameTypeDefaultDescription
valueboolfalseCurrent value of the toggle.
labelstringA label for the toggle.
inlineboolfalseWhether the label (not the onText/offText) should be positioned inline with the toggle control.
onTextstringText to display when toggle is ON. Caution: when not providing on/off text user may get confused in differentiating the on/off states of the toggle.
offTextstringText to display when toggle is OFF. Caution: when not providing on/off text user may get confused in differentiating the on/off states of the toggle.
focusedboolfalseWhen set to true the focus is set on the control when it's shown on the page or page opened.
datastringAdditional data attached to the control. The value is passed in change event data along with a toggle state.

Events​

NameDescription
changeFires when the state of toggle is changed.
focusFires when the control has received focus.
blurFires when the control has lost focus.