- Name
reason- Kind
- property
- Type
RadioGroupChangeReason- Requirement
- required
DocsAPI referenceUI machinesradio
radio machine
The public state machine contract for @grassroot/ui-machines/radio. The machine owns behaviour; the matching headless layer owns composition.
@grassroot/ui-machines/radio
Package
Service example
radio.tsts
import { createService } from "@grassroot/statechart";import { radioGroupMachine } from "@grassroot/ui-machines/radio"; const service = createService(radioGroupMachine, { input: {} });service.start();service.send({ type: "…" });service.stop();12 of 12
Exports
RadioGroupChangeReasonts
type RadioGroupChangeReason = "pointer" | "keyboard" | "programmatic";RadioGroupCommand
typeRadioGroupCommandts
type RadioGroupCommand = CommandObject & { readonly type: "VALUE_CHANGE_REQUEST"; readonly value: string; readonly reason: RadioGroupChangeReason;};Name
Kind
Type
Requirement
reasonproperty
RadioGroupChangeReasonrequired
typeproperty
stringrequired
valueproperty
stringrequired
- Name
type- Kind
- property
- Type
string- Requirement
- required
- Name
value- Kind
- property
- Type
string- Requirement
- required
RadioGroupContext
typeRadioGroupContextts
type RadioGroupContext = { readonly mode: BindingMode; readonly value: string | null;};Name
Kind
Type
Requirement
modeproperty
BindingModerequired
valueproperty
string | nullrequired
- Name
mode- Kind
- property
- Type
BindingMode- Requirement
- required
- Name
value- Kind
- property
- Type
string | null- Requirement
- required
RadioGroupDiagnosticCodests
export declare const RadioGroupDiagnosticCodes: readonly DiagnosticCatalogueEntry[];RadioGroupEvent
typeRadioGroupEventts
type RadioGroupEvent = { readonly type: "SELECT"; readonly value: string; readonly reason: RadioGroupChangeReason;} | { readonly type: "RESET";};RadioGroupInput
typeRadioGroupInputts
type RadioGroupInput = { /** Controlled committed value. Defining it fixes controlled mode at first start. */ readonly value?: string; /** Uncontrolled initial committed value. */ readonly defaultValue?: string; readonly disabled?: boolean; readonly readOnly?: boolean;};Name
Kind
Type
Requirement
Description
defaultValueproperty
stringoptional
Uncontrolled initial committed value.
disabledproperty
booleanoptional
—
readOnlyproperty
booleanoptional
—
valueproperty
stringoptional
Controlled committed value. Defining it fixes controlled mode at first start.
- Name
defaultValue- Kind
- property
- Type
string- Requirement
- optional
- Description
- Uncontrolled initial committed value.
- Name
disabled- Kind
- property
- Type
boolean- Requirement
- optional
- Description
- —
- Name
readOnly- Kind
- property
- Type
boolean- Requirement
- optional
- Description
- —
- Name
value- Kind
- property
- Type
string- Requirement
- optional
- Description
- Controlled committed value. Defining it fixes controlled mode at first start.
radioGroupMachine
valueradioGroupMachinets
export declare const radioGroupMachine: RadioGroupMachine;RadioGroupMachine
typeRadioGroupMachinets
type RadioGroupMachine = Machine<RadioGroupInput, RadioGroupStateValue, RadioGroupContext, RadioGroupEvent, RadioGroupCommand>;radioGroupReplaySequence
valueradioGroupReplaySequencets
export declare const radioGroupReplaySequence: readonly RadioGroupEvent[];radioGroupSelectors
valueradioGroupSelectorsts
export declare const radioGroupSelectors: { value: (snapshot: RadioGroupSnapshot) => string | null; isSelected: (snapshot: RadioGroupSnapshot, value: string) => boolean;};Name
Kind
Type
Requirement
isSelectedproperty
(snapshot: RadioGroupSnapshot, value: string) => booleanrequired
valueproperty
(snapshot: RadioGroupSnapshot) => string | nullrequired
- Name
isSelected- Kind
- property
- Type
(snapshot: RadioGroupSnapshot, value: string) => boolean- Requirement
- required
- Name
value- Kind
- property
- Type
(snapshot: RadioGroupSnapshot) => string | null- Requirement
- required
RadioGroupSnapshot
typeRadioGroupSnapshotts
type RadioGroupSnapshot = Snapshot<RadioGroupStateValue, RadioGroupContext>;RadioGroupStateValue
typeRadioGroupStateValuets
type RadioGroupStateValue = "ready";