API REFERENCE · FORM CONTROLS
<dj-switch>
A form-associated on/off toggle (role="switch") composing <dj-label>. Modeled like a checkbox; the checked flag is checked (the Dojo widget called it value — renamed here for consistency with checkbox/radio). Parts: control, label.
npm install @dojo-ng/switch
import "@dojo-ng/switch";
Properties
| Property | Attribute | Type | Default |
|---|---|---|---|
checked |
checked reflected |
boolean |
false |
value |
value |
string |
"on" |
name |
name reflected |
string |
None |
disabled |
disabled reflected |
boolean |
false |
readonly |
readonly reflected |
boolean |
false |
labelHidden |
label-hidden |
boolean |
false |
Events
change
Slots
Default slot
CSS parts
Style these with dj-switch::part(name).
controllabel
Methods
checkValidity(): booleanreportValidity(): booleanfocus(options: FocusOptions)restoreFormState(state: File | string | FormData | null)