Reference headless
checkbox
interface 3 type 5 function 1
# CheckboxContext
Members
togglestoggles: numberNumber of user-initiated toggles since construction.
valuevalue: CheckboxValueMirrored as
aria-checked("true" / "false" / "mixed").
# CheckboxController
Members
checkedreadonly checked: booleancontextreadonly context: Readonly<CheckboxContext>disabledreadonly disabled: booleanidreadonly id: stringindeterminatereadonly indeterminate: booleanmachinereadonly machine: CheckboxMachinerootreadonly root: Attachmentstatereadonly state: CheckboxStatevaluereadonly value: CheckboxValueset()set(value): voidsetDisabled()setDisabled(disabled): void###### Parameters
###### disabled
boolean###### Returns
voidsubscribe()subscribe(listener): () => void###### Parameters
###### listener
(
snapshot) =>void###### Returns
() =>
voidtoggle()toggle(): void###### Returns
void
# CreateCheckboxOptions
Members
disabled?optional disabled?: boolean###### Inherited from
CreateCheckboxInput.disabledid?optional id?: stringinitial?optional initial?: CheckboxValue###### Inherited from
CreateCheckboxInput.initialonCheckedChange?optional onCheckedChange?: (value) => voidUser-initiated value changes only. NOT called for controlled
set()updates that came from the parent.###### Parameters
###### value
###### Returns
void
# Attachment
Attachment = (node) => void | (() => void)Parameters
nodeHTMLElement
Returns
void | (() => void)# CheckboxEvent
CheckboxEvent = { type: "TOGGLE"; } | { type: "SET"; value: CheckboxValue; } | { type: "DISABLE"; } | { type: "ENABLE"; }# CheckboxMachine
CheckboxMachine = Machine<CheckboxContext, CheckboxEvent, CheckboxState># CheckboxState
CheckboxState = "unchecked" | "checked" | "mixed" | "disabled"# CheckboxValue
CheckboxValue = "unchecked" | "checked" | "mixed"The visible value. 'mixed' = indeterminate (parent w/ partly-checked children).
# createCheckbox ( )
createCheckbox(options?): CheckboxControllerCreate a Checkbox controller plus its {@attach}-compatible root attachment.
Parameters
options?CreateCheckboxOptions = {}
Returns
CheckboxController