@fabwcie/free-drawing / utils/dom / createSwitch
Function: createSwitch()
createSwitch(
checked?):HTMLInputElement
Defined in: packages/free-drawing/src/utils/dom.ts:46
On / off switch: checkbox announced as a switch (state read as on / off), keyboard (Space) and pointer as a checkbox
Parameters
checked?
boolean = false
initial state, on when true
Returns
HTMLInputElement
new checkbox with role switch, not added to the page