- Name
checked- Kind
- property
- Type
boolean- Requirement
- required
DocsAPI referenceUI machinescheckbox
checkbox machine
The public state machine contract for @grassroot/ui-machines/checkbox. The machine owns behaviour; the matching headless layer owns composition.
@grassroot/ui-machines/checkbox
Package
Service example
checkbox.tsts
import { createService } from "@grassroot/statechart";import { checkboxMachine } from "@grassroot/ui-machines/checkbox"; const service = createService(checkboxMachine, { input: {} });service.start();service.send({ type: "…" });service.stop();12 of 12
Exports
CheckboxCheckedValue
typeCheckboxCheckedValuets
type CheckboxCheckedValue = boolean | "indeterminate";CheckboxCommand
typeCheckboxCommandts
type CheckboxCommand = CommandObject & { readonly type: "CHECKED_CHANGE_REQUEST"; readonly checked: boolean; readonly reason: CheckboxReason;};Name
Kind
Type
Requirement
checkedproperty
booleanrequired
reasonproperty
CheckboxReasonrequired
typeproperty
stringrequired
- Name
reason- Kind
- property
- Type
CheckboxReason- Requirement
- required
- Name
type- Kind
- property
- Type
string- Requirement
- required
CheckboxContext
typeCheckboxContextts
type CheckboxContext = { readonly mode: BindingMode;};Name
Kind
Type
Requirement
modeproperty
BindingModerequired
- Name
mode- Kind
- property
- Type
BindingMode- Requirement
- required
CheckboxDiagnosticCodes
valueCheckboxDiagnosticCodests
export declare const CheckboxDiagnosticCodes: readonly DiagnosticCatalogueEntry[];CheckboxEvent
typeCheckboxEventts
type CheckboxEvent = { readonly type: "TOGGLE"; readonly reason: CheckboxReason;} | { readonly type: "RESET";};CheckboxInput
typeCheckboxInputts
type CheckboxInput = { readonly checked?: CheckboxCheckedValue; readonly defaultChecked?: CheckboxCheckedValue; readonly disabled?: boolean; readonly readOnly?: boolean;};Name
Kind
Type
Requirement
checkedproperty
CheckboxCheckedValueoptional
defaultCheckedproperty
CheckboxCheckedValueoptional
disabledproperty
booleanoptional
readOnlyproperty
booleanoptional
- Name
checked- Kind
- property
- Type
CheckboxCheckedValue- Requirement
- optional
- Name
defaultChecked- Kind
- property
- Type
CheckboxCheckedValue- Requirement
- optional
- Name
disabled- Kind
- property
- Type
boolean- Requirement
- optional
- Name
readOnly- Kind
- property
- Type
boolean- Requirement
- optional
checkboxMachine
valuecheckboxMachinets
export declare const checkboxMachine: Machine<CheckboxInput, CheckboxValue, CheckboxContext, CheckboxEvent, CheckboxCommand>;CheckboxReason
typeCheckboxReasonts
type CheckboxReason = "pointer" | "keyboard" | "programmatic";checkboxReplaySequence
valuecheckboxReplaySequencets
export declare const checkboxReplaySequence: readonly CheckboxEvent[];checkboxSelectors
valuecheckboxSelectorsts
export declare const checkboxSelectors: { checked: (snapshot: CheckboxSnapshot) => boolean; indeterminate: (snapshot: CheckboxSnapshot) => boolean; state: (snapshot: CheckboxSnapshot) => CheckboxValue;};Name
Kind
Type
Requirement
checkedproperty
(snapshot: CheckboxSnapshot) => booleanrequired
indeterminateproperty
(snapshot: CheckboxSnapshot) => booleanrequired
stateproperty
(snapshot: CheckboxSnapshot) => CheckboxValuerequired
- Name
checked- Kind
- property
- Type
(snapshot: CheckboxSnapshot) => boolean- Requirement
- required
- Name
indeterminate- Kind
- property
- Type
(snapshot: CheckboxSnapshot) => boolean- Requirement
- required
- Name
state- Kind
- property
- Type
(snapshot: CheckboxSnapshot) => CheckboxValue- Requirement
- required
CheckboxSnapshot
typeCheckboxSnapshotts
type CheckboxSnapshot = Snapshot<CheckboxValue, CheckboxContext>;CheckboxValue
typeCheckboxValuets
type CheckboxValue = "unchecked" | "checked" | "indeterminate";