DocsAPI referenceHeadlesscheckbox

checkbox headless API

The core connector and vanilla mount are always visible. Use the framework choice to inspect native composition, props, outputs, context and hooks for the selected adapter.

@grassroot/ui-headless-core/checkbox

Core connector and vanilla API

24 exports
View source packages/ui-headless/core/src/checkbox/index.ts

activateCheckbox

function
DeclarationView source
activateCheckboxts
declare function activateCheckbox(service: CheckboxService, scope: PartScope, options?: CheckboxConnectOptions): () => void;
Name
Kind
Type
Requirement
service
parameter
CheckboxService
required
scope
parameter
PartScope
required
options
parameter
CheckboxConnectOptions
optional
return
return value
() => void
n/a
Name
service
Kind
parameter
Type
CheckboxService
Requirement
required
Name
scope
Kind
parameter
Type
PartScope
Requirement
required
Name
options
Kind
parameter
Type
CheckboxConnectOptions
Requirement
optional
Name
return
Kind
return value
Type
() => void
Requirement
n/a
DeclarationView source
checkboxAnatomyts
export declare const checkboxAnatomy: readonly ["root", "hidden-input", "control", "indicator", "label", "description"];

CheckboxApi

interface
DeclarationView source
CheckboxApits
interface CheckboxApi {
rootProps(): PartProps;
hiddenInputProps(): PartProps;
controlProps(): PartProps;
indicatorProps(): PartProps;
labelProps(): PartProps;
descriptionProps(): PartProps;
/**
* Restores the registered hidden input's `checked` AND `indeterminate`
* DOM properties from the committed snapshot; a no-op without DOM. The
* Checkbox counterpart of Switch's `syncNativeChecked()`
* [checkbox.spec.md "Connector differences"].
*/
syncNativeState(): void;
readonly checked: boolean;
readonly indeterminate: boolean;
readonly disabled: boolean;
readonly readOnly: boolean;
}
Name
Kind
Type
Requirement
Description
checked
property
boolean
required
controlProps
method
() => PartProps
required
descriptionProps
method
() => PartProps
required
disabled
property
boolean
required
hiddenInputProps
method
() => PartProps
required
indeterminate
property
boolean
required
indicatorProps
method
() => PartProps
required
labelProps
method
() => PartProps
required
readOnly
property
boolean
required
rootProps
method
() => PartProps
required
syncNativeState
method
() => void
required
Restores the registered hidden input's `checked` AND `indeterminate` DOM properties from the committed snapshot; a no-op without DOM. The Checkbox counterpart of Switch's `syncNativeChecked()` [checkbox.spec.md "Connector differences"].
Name
checked
Kind
property
Type
boolean
Requirement
required
Description
Name
controlProps
Kind
method
Type
() => PartProps
Requirement
required
Description
Name
descriptionProps
Kind
method
Type
() => PartProps
Requirement
required
Description
Name
disabled
Kind
property
Type
boolean
Requirement
required
Description
Name
hiddenInputProps
Kind
method
Type
() => PartProps
Requirement
required
Description
Name
indeterminate
Kind
property
Type
boolean
Requirement
required
Description
Name
indicatorProps
Kind
method
Type
() => PartProps
Requirement
required
Description
Name
labelProps
Kind
method
Type
() => PartProps
Requirement
required
Description
Name
readOnly
Kind
property
Type
boolean
Requirement
required
Description
Name
rootProps
Kind
method
Type
() => PartProps
Requirement
required
Description
Name
syncNativeState
Kind
method
Type
() => void
Requirement
required
Description
Restores the registered hidden input's `checked` AND `indeterminate` DOM properties from the committed snapshot; a no-op without DOM. The Checkbox counterpart of Switch's `syncNativeChecked()` [checkbox.spec.md "Connector differences"].
DeclarationView source
CheckboxChangeDetailts
interface CheckboxChangeDetail {
readonly checked: boolean;
readonly reason: CheckboxReason;
}
Name
Kind
Type
Requirement
checked
property
boolean
required
reason
property
CheckboxReason
required
Name
checked
Kind
property
Type
boolean
Requirement
required
Name
reason
Kind
property
Type
CheckboxReason
Requirement
required
DeclarationView source
CheckboxCheckedValuets
type CheckboxCheckedValue = boolean | "indeterminate";
DeclarationView source
CheckboxCommandts
type CheckboxCommand = CommandObject & {
readonly type: "CHECKED_CHANGE_REQUEST";
readonly checked: boolean;
readonly reason: CheckboxReason;
};
Name
Kind
Type
Requirement
checked
property
boolean
required
reason
property
CheckboxReason
required
type
property
string
required
Name
checked
Kind
property
Type
boolean
Requirement
required
Name
reason
Kind
property
Type
CheckboxReason
Requirement
required
Name
type
Kind
property
Type
string
Requirement
required
DeclarationView source
CheckboxConnectOptionsts
interface CheckboxConnectOptions {
readonly onCheckedChange?: (detail: CheckboxChangeDetail) => void;
/** Framework-native passthrough [switch.spec.md #6, inherited]. */
readonly onChange?: (event: unknown) => void;
readonly name?: string;
readonly value?: string;
readonly required?: boolean;
/** Accessible-name escape hatch [baseline #17, inherited]. */
readonly ariaLabel?: string;
}
Name
Kind
Type
Requirement
Description
ariaLabel
property
string
optional
Accessible-name escape hatch [baseline #17, inherited].
name
property
string
optional
onChange
property
(event: unknown) => void
optional
Framework-native passthrough [switch.spec.md #6, inherited].
onCheckedChange
property
(detail: CheckboxChangeDetail) => void
optional
required
property
boolean
optional
value
property
string
optional
Name
ariaLabel
Kind
property
Type
string
Requirement
optional
Description
Accessible-name escape hatch [baseline #17, inherited].
Name
name
Kind
property
Type
string
Requirement
optional
Description
Name
onChange
Kind
property
Type
(event: unknown) => void
Requirement
optional
Description
Framework-native passthrough [switch.spec.md #6, inherited].
Name
onCheckedChange
Kind
property
Type
(detail: CheckboxChangeDetail) => void
Requirement
optional
Description
Name
required
Kind
property
Type
boolean
Requirement
optional
Description
Name
value
Kind
property
Type
string
Requirement
optional
Description
DeclarationView source
CheckboxContextts
type CheckboxContext = {
readonly mode: BindingMode;
};
Name
Kind
Type
Requirement
mode
property
BindingMode
required
Name
mode
Kind
property
Type
BindingMode
Requirement
required
DeclarationView source
CheckboxEventts
type CheckboxEvent = {
readonly type: "TOGGLE";
readonly reason: CheckboxReason;
} | {
readonly type: "RESET";
};
DeclarationView source
CheckboxInputts
type CheckboxInput = {
readonly checked?: CheckboxCheckedValue;
readonly defaultChecked?: CheckboxCheckedValue;
readonly disabled?: boolean;
readonly readOnly?: boolean;
};
Name
Kind
Type
Requirement
checked
property
CheckboxCheckedValue
optional
defaultChecked
property
CheckboxCheckedValue
optional
disabled
property
boolean
optional
readOnly
property
boolean
optional
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
DeclarationView source
checkboxMachinets
export declare const checkboxMachine: Machine<CheckboxInput, CheckboxValue, CheckboxContext, CheckboxEvent, CheckboxCommand>;

CheckboxMount

interface
DeclarationView source
CheckboxMountts
interface CheckboxMount {
readonly service: CheckboxService;
readonly connector: CheckboxApi;
readonly root: HTMLElement;
readonly input: HTMLInputElement;
readonly control: HTMLElement;
readonly indicator: HTMLElement;
readonly label: HTMLElement | null;
readonly description: HTMLElement | null;
destroy(): void;
}
Name
Kind
Type
Requirement
connector
property
CheckboxApi
required
control
property
HTMLElement
required
description
property
HTMLElement | null
required
destroy
method
() => void
required
indicator
property
HTMLElement
required
input
property
HTMLInputElement
required
label
property
HTMLElement | null
required
root
property
HTMLElement
required
service
property
CheckboxService
required
Name
connector
Kind
property
Type
CheckboxApi
Requirement
required
Name
control
Kind
property
Type
HTMLElement
Requirement
required
Name
description
Kind
property
Type
HTMLElement | null
Requirement
required
Name
destroy
Kind
method
Type
() => void
Requirement
required
Name
indicator
Kind
property
Type
HTMLElement
Requirement
required
Name
input
Kind
property
Type
HTMLInputElement
Requirement
required
Name
label
Kind
property
Type
HTMLElement | null
Requirement
required
Name
root
Kind
property
Type
HTMLElement
Requirement
required
Name
service
Kind
property
Type
CheckboxService
Requirement
required

Duck-typed hidden-input shape needed to restore both live DOM properties.

DeclarationView source
CheckboxNativeStateTargetts
interface CheckboxNativeStateTarget {
checked: boolean;
indeterminate: boolean;
}
Name
Kind
Type
Requirement
checked
property
boolean
required
indeterminate
property
boolean
required
Name
checked
Kind
property
Type
boolean
Requirement
required
Name
indeterminate
Kind
property
Type
boolean
Requirement
required
DeclarationView source
CheckboxPartts
type CheckboxPart = (typeof checkboxAnatomy)[number];
DeclarationView source
CheckboxReasonts
type CheckboxReason = "pointer" | "keyboard" | "programmatic";
DeclarationView source
checkboxSelectorsts
export declare const checkboxSelectors: {
checked: (snapshot: CheckboxSnapshot) => boolean;
indeterminate: (snapshot: CheckboxSnapshot) => boolean;
state: (snapshot: CheckboxSnapshot) => CheckboxValue;
};
Name
Kind
Type
Requirement
checked
property
(snapshot: CheckboxSnapshot) => boolean
required
indeterminate
property
(snapshot: CheckboxSnapshot) => boolean
required
state
property
(snapshot: CheckboxSnapshot) => CheckboxValue
required
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
DeclarationView source
CheckboxServicets
type CheckboxService = Service<CheckboxInput, CheckboxValue, CheckboxContext, CheckboxEvent, CheckboxCommand>;
DeclarationView source
CheckboxSnapshotts
type CheckboxSnapshot = Snapshot<CheckboxValue, CheckboxContext>;
DeclarationView source
CheckboxValuets
type CheckboxValue = "unchecked" | "checked" | "indeterminate";

connectCheckbox

function
DeclarationView source
connectCheckboxts
declare function connectCheckbox(service: CheckboxService, scope: PartScope, options?: CheckboxConnectOptions): CheckboxApi;
Name
Kind
Type
Requirement
service
parameter
CheckboxService
required
scope
parameter
PartScope
required
options
parameter
CheckboxConnectOptions
optional
return
return value
CheckboxApi
n/a
Name
service
Kind
parameter
Type
CheckboxService
Requirement
required
Name
scope
Kind
parameter
Type
PartScope
Requirement
required
Name
options
Kind
parameter
Type
CheckboxConnectOptions
Requirement
optional
Name
return
Kind
return value
Type
CheckboxApi
Requirement
n/a

mountCheckbox

function
DeclarationView source
mountCheckboxts
declare function mountCheckbox(container: HTMLElement, options?: MountCheckboxOptions): CheckboxMount;
Name
Kind
Type
Requirement
container
parameter
HTMLElement
required
options
parameter
MountCheckboxOptions
optional
return
return value
CheckboxMount
n/a
Name
container
Kind
parameter
Type
HTMLElement
Requirement
required
Name
options
Kind
parameter
Type
MountCheckboxOptions
Requirement
optional
Name
return
Kind
return value
Type
CheckboxMount
Requirement
n/a
DeclarationView source
MountCheckboxOptionsts
interface MountCheckboxOptions extends CheckboxInput {
readonly onCheckedChange?: (detail: CheckboxChangeDetail) => void;
/** Framework-native passthrough. */
readonly onChange?: (event: unknown) => void;
readonly name?: string;
readonly value?: string;
readonly required?: boolean;
/** Accessible-name escape hatch. */
readonly ariaLabel?: string;
/** Omits the Label/Description parts entirely (the contract's "bare" scenario) — pair with `ariaLabel`. */
readonly bare?: boolean;
/** Render callback for the label's content; default = "Checkbox" as textContent. Ignored when `bare`. */
readonly renderLabel?: (label: HTMLElement) => void;
/** Render callback for the description's content; default = untouched (empty). Ignored when `bare`. */
readonly renderDescription?: (description: HTMLElement) => void;
}
Name
Kind
Type
Requirement
Description
ariaLabel
property
string
optional
Accessible-name escape hatch.
bare
property
boolean
optional
Omits the Label/Description parts entirely (the contract's "bare" scenario) — pair with `ariaLabel`.
name
property
string
optional
onChange
property
(event: unknown) => void
optional
Framework-native passthrough.
onCheckedChange
property
(detail: CheckboxChangeDetail) => void
optional
renderDescription
property
(description: HTMLElement) => void
optional
Render callback for the description's content; default = untouched (empty). Ignored when `bare`.
renderLabel
property
(label: HTMLElement) => void
optional
Render callback for the label's content; default = "Checkbox" as textContent. Ignored when `bare`.
required
property
boolean
optional
value
property
string
optional
Name
ariaLabel
Kind
property
Type
string
Requirement
optional
Description
Accessible-name escape hatch.
Name
bare
Kind
property
Type
boolean
Requirement
optional
Description
Omits the Label/Description parts entirely (the contract's "bare" scenario) — pair with `ariaLabel`.
Name
name
Kind
property
Type
string
Requirement
optional
Description
Name
onChange
Kind
property
Type
(event: unknown) => void
Requirement
optional
Description
Framework-native passthrough.
Name
onCheckedChange
Kind
property
Type
(detail: CheckboxChangeDetail) => void
Requirement
optional
Description
Name
renderDescription
Kind
property
Type
(description: HTMLElement) => void
Requirement
optional
Description
Render callback for the description's content; default = untouched (empty). Ignored when `bare`.
Name
renderLabel
Kind
property
Type
(label: HTMLElement) => void
Requirement
optional
Description
Render callback for the label's content; default = "Checkbox" as textContent. Ignored when `bare`.
Name
required
Kind
property
Type
boolean
Requirement
optional
Description
Name
value
Kind
property
Type
string
Requirement
optional
Description

Sets both `checked` and `indeterminate` from a committed Checkbox value, writing only what actually changed (no churn) — the same discipline `restoreNativeChecked` (Switch, `../hidden-input.js`) uses for its single property. `indeterminate` has no HTML content attribute, so this is the only path that can ever carry it: `connectCheckbox`'s `onChange` handler, `activateCheckbox`'s reset restore, and `mountCheckbox`'s render loop all go through this one function.

DeclarationView source
restoreNativeCheckboxStatets
declare function restoreNativeCheckboxState(input: CheckboxNativeStateTarget | null, next: {
readonly checked: boolean;
readonly indeterminate: boolean;
}): void;
Name
Kind
Type
Requirement
input
parameter
CheckboxNativeStateTarget | null
required
next
parameter
{ readonly checked: boolean; readonly indeterminate: boolean; }
required
return
return value
void
n/a
Name
input
Kind
parameter
Type
CheckboxNativeStateTarget | null
Requirement
required
Name
next
Kind
parameter
Type
{ readonly checked: boolean; readonly indeterminate: boolean; }
Requirement
required
Name
return
Kind
return value
Type
void
Requirement
n/a

Checkbox-shaped command runner — mirrors `runSwitchCommand`. Pass this as the `runCommand` option when constructing the Checkbox `Service` (never called by `connectCheckbox` itself). Maps `CHECKED_CHANGE_REQUEST` to exactly one `onCheckedChange({ checked, reason })` — no adapter compares snapshots to infer the callback.

DeclarationView source
runCheckboxCommandts
declare function runCheckboxCommand(command: CheckboxCommand, options?: CheckboxConnectOptions): void;
Name
Kind
Type
Requirement
command
parameter
CheckboxCommand
required
options
parameter
CheckboxConnectOptions
optional
return
return value
void
n/a
Name
command
Kind
parameter
Type
CheckboxCommand
Requirement
required
Name
options
Kind
parameter
Type
CheckboxConnectOptions
Requirement
optional
Name
return
Kind
return value
Type
void
Requirement
n/a

Framework adapters

Each panel keeps its adapter's public vocabulary. React compound exports, Vue composables, standalone Angular declarations, Svelte components, and Solid hooks stay native to their framework.

React example follows below.

React imports

@grassroot/ui-headless-react/checkboxts
import { Checkbox, Control, Description, Indicator, Label, Root, RootProvider } from "@grassroot/ui-headless-react/checkbox";

Vue imports

@grassroot/ui-headless-vue/checkboxts
<script setup lang="ts">
import { CheckboxControl, CheckboxDescription, CheckboxIndicator, CheckboxLabel, CheckboxRoot, CheckboxRootProvider } from "@grassroot/ui-headless-vue/checkbox";
</script>

Angular imports

@grassroot/ui-headless-angular/checkboxts
import { Component } from "@angular/core";
import { GR_CHECKBOX_DECLARATIONS } from "@grassroot/ui-headless-angular/checkbox";
@Component({ standalone: true, imports: [GR_CHECKBOX_DECLARATIONS], template: `<!-- compose the checkbox parts here -->` })
export class Example {}

Svelte imports

@grassroot/ui-headless-svelte/checkboxts
<script lang="ts">
import { CheckboxControl, CheckboxDescription, CheckboxIndicator, CheckboxLabel, CheckboxRoot, CheckboxRootProvider } from "@grassroot/ui-headless-svelte/checkbox";
</script>

Solid imports

@grassroot/ui-headless-solid/checkboxts
import { CheckboxControl, CheckboxDescription, CheckboxIndicator, CheckboxLabel, CheckboxRoot, CheckboxRootProvider } from "@grassroot/ui-headless-solid/checkbox";

@grassroot/ui-headless-react/checkbox

React adapter

17 exports
View source packages/ui-headless/react/src/checkbox/index.ts

Checkbox

value
DeclarationView source
Checkboxts
export declare const Checkbox: {
Root: import("react").ForwardRefExoticComponent<CheckboxRootProps & import("react").RefAttributes<HTMLLabelElement>>;
RootProvider: import("react").ForwardRefExoticComponent<CheckboxRootProviderProps & import("react").RefAttributes<HTMLLabelElement>>;
HiddenInput: import("react").ForwardRefExoticComponent<CheckboxHiddenInputProps & import("react").RefAttributes<HTMLInputElement>>;
Control: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
asChild?: boolean;
} & import("react").RefAttributes<HTMLSpanElement>>;
Indicator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
asChild?: boolean;
} & import("react").RefAttributes<HTMLSpanElement>>;
Label: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
asChild?: boolean;
} & import("react").RefAttributes<HTMLSpanElement>>;
Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
asChild?: boolean;
} & import("react").RefAttributes<HTMLSpanElement>>;
};
Name
Kind
Type
Requirement
Control
property
import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & { asChild?: boolean; } & import("react").RefAttributes<HTMLSpanElement>>
required
Description
property
import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & { asChild?: boolean; } & import("react").RefAttributes<HTMLSpanElement>>
required
HiddenInput
property
import("react").ForwardRefExoticComponent<CheckboxHiddenInputProps & import("react").RefAttributes<HTMLInputElement>>
required
Indicator
property
import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & { asChild?: boolean; } & import("react").RefAttributes<HTMLSpanElement>>
required
Label
property
import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & { asChild?: boolean; } & import("react").RefAttributes<HTMLSpanElement>>
required
Root
property
import("react").ForwardRefExoticComponent<CheckboxRootProps & import("react").RefAttributes<HTMLLabelElement>>
required
RootProvider
property
import("react").ForwardRefExoticComponent<CheckboxRootProviderProps & import("react").RefAttributes<HTMLLabelElement>>
required
Name
Control
Kind
property
Type
import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & { asChild?: boolean; } & import("react").RefAttributes<HTMLSpanElement>>
Requirement
required
Name
Description
Kind
property
Type
import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & { asChild?: boolean; } & import("react").RefAttributes<HTMLSpanElement>>
Requirement
required
Name
HiddenInput
Kind
property
Type
import("react").ForwardRefExoticComponent<CheckboxHiddenInputProps & import("react").RefAttributes<HTMLInputElement>>
Requirement
required
Name
Indicator
Kind
property
Type
import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & { asChild?: boolean; } & import("react").RefAttributes<HTMLSpanElement>>
Requirement
required
Name
Label
Kind
property
Type
import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & { asChild?: boolean; } & import("react").RefAttributes<HTMLSpanElement>>
Requirement
required
Name
Root
Kind
property
Type
import("react").ForwardRefExoticComponent<CheckboxRootProps & import("react").RefAttributes<HTMLLabelElement>>
Requirement
required
Name
RootProvider
Kind
property
Type
import("react").ForwardRefExoticComponent<CheckboxRootProviderProps & import("react").RefAttributes<HTMLLabelElement>>
Requirement
required
DeclarationView source
CheckboxContextts
export declare const CheckboxContext: import("react").Context<CheckboxContextValue | null>;
Name
Kind
Type
Requirement
props
parameter
P
required
return
return value
ReactNode
n/a
Name
props
Kind
parameter
Type
P
Requirement
required
Name
return
Kind
return value
Type
ReactNode
Requirement
n/a
DeclarationView source
CheckboxContextValuets
interface CheckboxContextValue {
readonly service: CheckboxService;
readonly connector: CheckboxApi;
readonly scope: PartScope;
}
Name
Kind
Type
Requirement
connector
property
CheckboxApi
required
scope
property
PartScope
required
service
property
CheckboxService
required
Name
connector
Kind
property
Type
CheckboxApi
Requirement
required
Name
scope
Kind
property
Type
PartScope
Requirement
required
Name
service
Kind
property
Type
CheckboxService
Requirement
required
DeclarationView source
CheckboxHiddenInputPropsts
interface CheckboxHiddenInputProps extends Omit<ComponentPropsWithoutRef<"input">, "checked" | "defaultChecked" | "disabled"> {
readonly asChild?: boolean;
}
Name
Kind
Type
Requirement
asChild
property
boolean
optional
Name
asChild
Kind
property
Type
boolean
Requirement
optional

CheckboxRootProps

interface
DeclarationView source
CheckboxRootPropsts
interface CheckboxRootProps extends Omit<ComponentPropsWithoutRef<"label">, "defaultChecked" | "checked" | "disabled" | "onChange"> {
readonly asChild?: boolean;
readonly checked?: CheckboxInput["checked"];
readonly defaultChecked?: CheckboxInput["defaultChecked"];
readonly disabled?: CheckboxInput["disabled"];
readonly readOnly?: CheckboxInput["readOnly"];
readonly name?: string;
readonly value?: string;
readonly required?: boolean;
/** Accessible-name escape hatch [inherited from Switch's baseline #17] — see `Checkbox.Label` for the primary path. */
readonly ariaLabel?: string;
/**
* Seeds the part scope INSTEAD of the generated id when supplied
* [inherited from Switch's baseline #10]: `<Checkbox.Root id="terms">`
* yields deterministic `hidden-input`/`label`/`description` ids derived
* from `"terms"`. Feeds `useCheckbox`'s `id` option — see that hook's doc
* comment. Intercepted here rather than left in the native passthrough, so
* it configures the scope seed instead of landing on the rendered
* `<label>` as a plain HTML `id` attribute.
*/
readonly id?: string;
readonly onCheckedChange?: (detail: CheckboxChangeDetail) => void;
readonly onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
readonly children?: ReactNode;
}
Name
Kind
Type
Requirement
Description
ariaLabel
property
string
optional
Accessible-name escape hatch [inherited from Switch's baseline #17] — see `Checkbox.Label` for the primary path.
asChild
property
boolean
optional
checked
property
CheckboxInput["checked"]
optional
children
property
ReactNode
optional
defaultChecked
property
CheckboxInput["defaultChecked"]
optional
disabled
property
CheckboxInput["disabled"]
optional
id
property
string
optional
Seeds the part scope INSTEAD of the generated id when supplied [inherited from Switch's baseline #10]: `<Checkbox.Root id="terms">` yields deterministic `hidden-input`/`label`/`description` ids derived from `"terms"`. Feeds `useCheckbox`'s `id` option — see that hook's doc comment. Intercepted here rather than left in the native passthrough, so it configures the scope seed instead of landing on the rendered `<label>` as a plain HTML `id` attribute.
name
property
string
optional
onChange
property
(event: ChangeEvent<HTMLInputElement>) => void
optional
onCheckedChange
property
(detail: CheckboxChangeDetail) => void
optional
readOnly
property
CheckboxInput["readOnly"]
optional
required
property
boolean
optional
value
property
string
optional
Name
ariaLabel
Kind
property
Type
string
Requirement
optional
Description
Accessible-name escape hatch [inherited from Switch's baseline #17] — see `Checkbox.Label` for the primary path.
Name
asChild
Kind
property
Type
boolean
Requirement
optional
Description
Name
checked
Kind
property
Type
CheckboxInput["checked"]
Requirement
optional
Description
Name
children
Kind
property
Type
ReactNode
Requirement
optional
Description
Name
defaultChecked
Kind
property
Type
CheckboxInput["defaultChecked"]
Requirement
optional
Description
Name
disabled
Kind
property
Type
CheckboxInput["disabled"]
Requirement
optional
Description
Name
id
Kind
property
Type
string
Requirement
optional
Description
Seeds the part scope INSTEAD of the generated id when supplied [inherited from Switch's baseline #10]: `<Checkbox.Root id="terms">` yields deterministic `hidden-input`/`label`/`description` ids derived from `"terms"`. Feeds `useCheckbox`'s `id` option — see that hook's doc comment. Intercepted here rather than left in the native passthrough, so it configures the scope seed instead of landing on the rendered `<label>` as a plain HTML `id` attribute.
Name
name
Kind
property
Type
string
Requirement
optional
Description
Name
onChange
Kind
property
Type
(event: ChangeEvent<HTMLInputElement>) => void
Requirement
optional
Description
Name
onCheckedChange
Kind
property
Type
(detail: CheckboxChangeDetail) => void
Requirement
optional
Description
Name
readOnly
Kind
property
Type
CheckboxInput["readOnly"]
Requirement
optional
Description
Name
required
Kind
property
Type
boolean
Requirement
optional
Description
Name
value
Kind
property
Type
string
Requirement
optional
Description
DeclarationView source
CheckboxRootProviderPropsts
interface CheckboxRootProviderProps extends Omit<ComponentPropsWithoutRef<"label">, "defaultChecked" | "checked" | "disabled" | "onChange" | "value"> {
readonly asChild?: boolean;
/** An existing `useCheckbox()` result (advanced composition) — already fully configured. */
readonly value: UseCheckboxResult;
readonly children?: ReactNode;
}
Name
Kind
Type
Requirement
Description
asChild
property
boolean
optional
children
property
ReactNode
optional
value
property
UseCheckboxResult
required
An existing `useCheckbox()` result (advanced composition) — already fully configured.
Name
asChild
Kind
property
Type
boolean
Requirement
optional
Description
Name
children
Kind
property
Type
ReactNode
Requirement
optional
Description
Name
value
Kind
property
Type
UseCheckboxResult
Requirement
required
Description
An existing `useCheckbox()` result (advanced composition) — already fully configured.

Control

value
DeclarationView source
Controlts
export declare const Control: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
asChild?: boolean;
} & import("react").RefAttributes<HTMLSpanElement>>;
Name
Kind
Type
Requirement
props
parameter
P
required
return
return value
ReactNode
n/a
Name
props
Kind
parameter
Type
P
Requirement
required
Name
return
Kind
return value
Type
ReactNode
Requirement
n/a

Description

value
DeclarationView source
Descriptionts
export declare const Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
asChild?: boolean;
} & import("react").RefAttributes<HTMLSpanElement>>;
Name
Kind
Type
Requirement
props
parameter
P
required
return
return value
ReactNode
n/a
Name
props
Kind
parameter
Type
P
Requirement
required
Name
return
Kind
return value
Type
ReactNode
Requirement
n/a

HiddenInput

value
DeclarationView source
HiddenInputts
export declare const HiddenInput: import("react").ForwardRefExoticComponent<CheckboxHiddenInputProps & import("react").RefAttributes<HTMLInputElement>>;
Name
Kind
Type
Requirement
props
parameter
P
required
return
return value
ReactNode
n/a
Name
props
Kind
parameter
Type
P
Requirement
required
Name
return
Kind
return value
Type
ReactNode
Requirement
n/a

Indicator

value
DeclarationView source
Indicatorts
export declare const Indicator: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
asChild?: boolean;
} & import("react").RefAttributes<HTMLSpanElement>>;
Name
Kind
Type
Requirement
props
parameter
P
required
return
return value
ReactNode
n/a
Name
props
Kind
parameter
Type
P
Requirement
required
Name
return
Kind
return value
Type
ReactNode
Requirement
n/a

Label

value
DeclarationView source
Labelts
export declare const Label: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
asChild?: boolean;
} & import("react").RefAttributes<HTMLSpanElement>>;
Name
Kind
Type
Requirement
props
parameter
P
required
return
return value
ReactNode
n/a
Name
props
Kind
parameter
Type
P
Requirement
required
Name
return
Kind
return value
Type
ReactNode
Requirement
n/a

Root

value
DeclarationView source
Rootts
export declare const Root: import("react").ForwardRefExoticComponent<CheckboxRootProps & import("react").RefAttributes<HTMLLabelElement>>;
Name
Kind
Type
Requirement
props
parameter
P
required
return
return value
ReactNode
n/a
Name
props
Kind
parameter
Type
P
Requirement
required
Name
return
Kind
return value
Type
ReactNode
Requirement
n/a

RootProvider

value
DeclarationView source
RootProviderts
export declare const RootProvider: import("react").ForwardRefExoticComponent<CheckboxRootProviderProps & import("react").RefAttributes<HTMLLabelElement>>;
Name
Kind
Type
Requirement
props
parameter
P
required
return
return value
ReactNode
n/a
Name
props
Kind
parameter
Type
P
Requirement
required
Name
return
Kind
return value
Type
ReactNode
Requirement
n/a

useCheckbox

function
DeclarationView source
useCheckboxts
declare function useCheckbox(input: CheckboxInput, options?: UseCheckboxOptions): UseCheckboxResult;
Name
Kind
Type
Requirement
input
parameter
CheckboxInput
required
options
parameter
UseCheckboxOptions
optional
return
return value
UseCheckboxResult
n/a
Name
input
Kind
parameter
Type
CheckboxInput
Requirement
required
Name
options
Kind
parameter
Type
UseCheckboxOptions
Requirement
optional
Name
return
Kind
return value
Type
UseCheckboxResult
Requirement
n/a
DeclarationView source
useCheckboxContextts
declare function useCheckboxContext(partName: string): CheckboxContextValue;
Name
Kind
Type
Requirement
partName
parameter
string
required
return
return value
CheckboxContextValue
n/a
Name
partName
Kind
parameter
Type
string
Requirement
required
Name
return
Kind
return value
Type
CheckboxContextValue
Requirement
n/a

UseCheckboxOptions

interface
DeclarationView source
UseCheckboxOptionsts
interface UseCheckboxOptions {
readonly onCheckedChange?: (detail: CheckboxChangeDetail) => void;
readonly onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
readonly name?: string;
readonly value?: string;
readonly required?: boolean;
readonly ariaLabel?: string;
readonly id?: string;
}
Name
Kind
Type
Requirement
ariaLabel
property
string
optional
id
property
string
optional
name
property
string
optional
onChange
property
(event: ChangeEvent<HTMLInputElement>) => void
optional
onCheckedChange
property
(detail: CheckboxChangeDetail) => void
optional
required
property
boolean
optional
value
property
string
optional
Name
ariaLabel
Kind
property
Type
string
Requirement
optional
Name
id
Kind
property
Type
string
Requirement
optional
Name
name
Kind
property
Type
string
Requirement
optional
Name
onChange
Kind
property
Type
(event: ChangeEvent<HTMLInputElement>) => void
Requirement
optional
Name
onCheckedChange
Kind
property
Type
(detail: CheckboxChangeDetail) => void
Requirement
optional
Name
required
Kind
property
Type
boolean
Requirement
optional
Name
value
Kind
property
Type
string
Requirement
optional

UseCheckboxResult

interface
DeclarationView source
UseCheckboxResultts
interface UseCheckboxResult {
readonly service: CheckboxService;
readonly connector: CheckboxApi;
readonly scope: PartScope;
readonly snapshot: CheckboxSnapshot;
}
Name
Kind
Type
Requirement
connector
property
CheckboxApi
required
scope
property
PartScope
required
service
property
CheckboxService
required
snapshot
property
CheckboxSnapshot
required
Name
connector
Kind
property
Type
CheckboxApi
Requirement
required
Name
scope
Kind
property
Type
PartScope
Requirement
required
Name
service
Kind
property
Type
CheckboxService
Requirement
required
Name
snapshot
Kind
property
Type
CheckboxSnapshot
Requirement
required

@grassroot/ui-headless-vue/checkbox

Vue adapter

13 exports
View source packages/ui-headless/vue/src/checkbox/index.ts
DeclarationView source
CheckboxContextKeyts
export declare const CheckboxContextKey: InjectionKey<CheckboxContextValue>;
DeclarationView source
CheckboxContextValuets
interface CheckboxContextValue {
readonly service: CheckboxService;
readonly connector: CheckboxApi;
readonly scope: PartScope;
/** Bumped on every committed machine update; parts read `.value` to establish a reactive dependency. */
readonly snapshot: ShallowRef<CheckboxSnapshot>;
}
Name
Kind
Type
Requirement
Description
connector
property
CheckboxApi
required
scope
property
PartScope
required
service
property
CheckboxService
required
snapshot
property
ShallowRef<CheckboxSnapshot>
required
Bumped on every committed machine update; parts read `.value` to establish a reactive dependency.
Name
connector
Kind
property
Type
CheckboxApi
Requirement
required
Description
Name
scope
Kind
property
Type
PartScope
Requirement
required
Description
Name
service
Kind
property
Type
CheckboxService
Requirement
required
Description
Name
snapshot
Kind
property
Type
ShallowRef<CheckboxSnapshot>
Requirement
required
Description
Bumped on every committed machine update; parts read `.value` to establish a reactive dependency.
DeclarationView source
CheckboxControlts
export declare const CheckboxControl: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
}>> & Readonly<{}>, {
asChild: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
DeclarationView source
CheckboxDescriptionts
export declare const CheckboxDescription: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
}>> & Readonly<{}>, {
asChild: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
DeclarationView source
CheckboxHiddenInputts
export declare const CheckboxHiddenInput: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
}>> & Readonly<{}>, {
asChild: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
DeclarationView source
CheckboxIndicatorts
export declare const CheckboxIndicator: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
}>> & Readonly<{}>, {
asChild: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
DeclarationView source
CheckboxLabelts
export declare const CheckboxLabel: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
}>> & Readonly<{}>, {
asChild: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

CheckboxRoot

value
DeclarationView source
CheckboxRootts
export declare const CheckboxRoot: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
checked: {
type: PropType<CheckboxInput["checked"]>;
default: undefined;
};
defaultChecked: {
type: PropType<CheckboxInput["defaultChecked"]>;
default: undefined;
};
disabled: {
type: PropType<CheckboxInput["disabled"]>;
default: undefined;
};
readOnly: {
type: PropType<CheckboxInput["readOnly"]>;
default: undefined;
};
name: {
type: PropType<string | undefined>;
default: undefined;
};
value: {
type: PropType<string | undefined>;
default: undefined;
};
required: {
type: PropType<boolean | undefined>;
default: undefined;
};
/** Accessible-name escape hatch [baseline #17, inherited] — see `CheckboxLabel` for the primary path. */
ariaLabel: {
type: PropType<string | undefined>;
default: undefined;
};
/**
* Seeds the part scope INSTEAD of the generated id when supplied
* [baseline #10, inherited]: `<CheckboxRoot id="terms">` yields
* deterministic `hidden-input`/`label`/`description` ids derived from
* `"terms"`. Feeds `useCheckbox`'s `id` option — see that composable's
* doc comment. Declared as a real prop (not left to fall through to
* `attrs`) so it configures the scope seed instead of landing on the
* rendered `<label>` as a plain HTML `id` attribute.
*/
id: {
type: PropType<string | undefined>;
default: undefined;
};
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
checkedChange: (_detail: CheckboxChangeDetail) => true;
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
checked: {
type: PropType<CheckboxInput["checked"]>;
default: undefined;
};
defaultChecked: {
type: PropType<CheckboxInput["defaultChecked"]>;
default: undefined;
};
disabled: {
type: PropType<CheckboxInput["disabled"]>;
default: undefined;
};
readOnly: {
type: PropType<CheckboxInput["readOnly"]>;
default: undefined;
};
name: {
type: PropType<string | undefined>;
default: undefined;
};
value: {
type: PropType<string | undefined>;
default: undefined;
};
required: {
type: PropType<boolean | undefined>;
default: undefined;
};
/** Accessible-name escape hatch [baseline #17, inherited] — see `CheckboxLabel` for the primary path. */
ariaLabel: {
type: PropType<string | undefined>;
default: undefined;
};
/**
* Seeds the part scope INSTEAD of the generated id when supplied
* [baseline #10, inherited]: `<CheckboxRoot id="terms">` yields
* deterministic `hidden-input`/`label`/`description` ids derived from
* `"terms"`. Feeds `useCheckbox`'s `id` option — see that composable's
* doc comment. Declared as a real prop (not left to fall through to
* `attrs`) so it configures the scope seed instead of landing on the
* rendered `<label>` as a plain HTML `id` attribute.
*/
id: {
type: PropType<string | undefined>;
default: undefined;
};
}>> & Readonly<{
onCheckedChange?: ((_detail: CheckboxChangeDetail) => any) | undefined;
}>, {
asChild: boolean;
checked: import("@grassroot/ui-machines/checkbox").CheckboxCheckedValue | undefined;
defaultChecked: import("@grassroot/ui-machines/checkbox").CheckboxCheckedValue | undefined;
disabled: boolean | undefined;
readOnly: boolean | undefined;
name: string | undefined;
value: string | undefined;
required: boolean | undefined;
ariaLabel: string | undefined;
id: string | undefined;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
DeclarationView source
CheckboxRootProviderts
export declare const CheckboxRootProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
/** An existing `useCheckbox()` result (advanced composition) — already fully configured. */
value: {
type: PropType<UseCheckboxResult>;
required: true;
};
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
asChild: {
type: BooleanConstructor;
default: boolean;
};
/** An existing `useCheckbox()` result (advanced composition) — already fully configured. */
value: {
type: PropType<UseCheckboxResult>;
required: true;
};
}>> & Readonly<{}>, {
asChild: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

useCheckbox

function
DeclarationView source
useCheckboxts
declare function useCheckbox(input: CheckboxInput | (() => CheckboxInput), options?: UseCheckboxOptions | (() => UseCheckboxOptions)): UseCheckboxResult;
Name
Kind
Type
Requirement
input
parameter
CheckboxInput | (() => CheckboxInput)
required
options
parameter
UseCheckboxOptions | (() => UseCheckboxOptions)
optional
return
return value
UseCheckboxResult
n/a
Name
input
Kind
parameter
Type
CheckboxInput | (() => CheckboxInput)
Requirement
required
Name
options
Kind
parameter
Type
UseCheckboxOptions | (() => UseCheckboxOptions)
Requirement
optional
Name
return
Kind
return value
Type
UseCheckboxResult
Requirement
n/a
DeclarationView source
useCheckboxContextts
declare function useCheckboxContext(partName: string): CheckboxContextValue;
Name
Kind
Type
Requirement
partName
parameter
string
required
return
return value
CheckboxContextValue
n/a
Name
partName
Kind
parameter
Type
string
Requirement
required
Name
return
Kind
return value
Type
CheckboxContextValue
Requirement
n/a

UseCheckboxOptions

interface
DeclarationView source
UseCheckboxOptionsts
interface UseCheckboxOptions {
readonly onCheckedChange?: (detail: CheckboxChangeDetail) => void;
readonly onChange?: (event: Event) => void;
readonly name?: string;
readonly value?: string;
readonly required?: boolean;
readonly ariaLabel?: string;
readonly id?: string;
}
Name
Kind
Type
Requirement
ariaLabel
property
string
optional
id
property
string
optional
name
property
string
optional
onChange
property
(event: Event) => void
optional
onCheckedChange
property
(detail: CheckboxChangeDetail) => void
optional
required
property
boolean
optional
value
property
string
optional
Name
ariaLabel
Kind
property
Type
string
Requirement
optional
Name
id
Kind
property
Type
string
Requirement
optional
Name
name
Kind
property
Type
string
Requirement
optional
Name
onChange
Kind
property
Type
(event: Event) => void
Requirement
optional
Name
onCheckedChange
Kind
property
Type
(detail: CheckboxChangeDetail) => void
Requirement
optional
Name
required
Kind
property
Type
boolean
Requirement
optional
Name
value
Kind
property
Type
string
Requirement
optional

UseCheckboxResult

interface
DeclarationView source
UseCheckboxResultts
interface UseCheckboxResult {
readonly service: CheckboxService;
readonly connector: CheckboxApi;
readonly scope: PartScope;
readonly snapshot: ShallowRef<CheckboxSnapshot>;
}
Name
Kind
Type
Requirement
connector
property
CheckboxApi
required
scope
property
PartScope
required
service
property
CheckboxService
required
snapshot
property
ShallowRef<CheckboxSnapshot>
required
Name
connector
Kind
property
Type
CheckboxApi
Requirement
required
Name
scope
Kind
property
Type
PartScope
Requirement
required
Name
service
Kind
property
Type
CheckboxService
Requirement
required
Name
snapshot
Kind
property
Type
ShallowRef<CheckboxSnapshot>
Requirement
required

@grassroot/ui-headless-angular/checkbox

Angular adapter

15 exports
View source packages/ui-headless/angular/src/checkbox/index.ts
DeclarationView source
CHECKBOX_STOREts
export declare const CHECKBOX_STORE: InjectionToken<CheckboxStore>;
DeclarationView source
CheckboxChangeDetailts
export interface CheckboxChangeDetail {
readonly checked: boolean;
readonly reason: CheckboxReason;
}
Name
Kind
Type
Requirement
checked
property
boolean
required
reason
property
CheckboxReason
required
Name
checked
Kind
property
Type
boolean
Requirement
required
Name
reason
Kind
property
Type
CheckboxReason
Requirement
required
DeclarationView source
CheckboxConnectOptionsPatchts
export interface CheckboxConnectOptionsPatch {
readonly name?: string;
readonly value?: string;
readonly required?: boolean;
readonly ariaLabel?: string;
}
Name
Kind
Type
Requirement
ariaLabel
property
string
optional
name
property
string
optional
required
property
boolean
optional
value
property
string
optional
Name
ariaLabel
Kind
property
Type
string
Requirement
optional
Name
name
Kind
property
Type
string
Requirement
optional
Name
required
Kind
property
Type
boolean
Requirement
optional
Name
value
Kind
property
Type
string
Requirement
optional

CheckboxStore

interface
DeclarationView source
CheckboxStorets
export interface CheckboxStore {
readonly service: CheckboxService;
readonly connector: CheckboxApi;
readonly scope: PartScope;
/**
* Bumped on every committed machine update — AND, defensively, once by
* `GrCheckboxLabel`/`GrCheckboxDescription` right after they self-register
* (see `parts.ts`). Effects that read the connector's prop bags must read
* this signal first — inside the same `effect()` — so Angular's
* reactivity re-runs the effect on every committed change, AND so
* `GrCheckboxHiddenInput`'s `aria-labelledby`/`aria-describedby` (resolved
* from `scope.get("label"/"description")` at getter-call time) settle
* once those parts exist. `GrCheckboxHiddenInput`'s effect also calls
* `connector.syncNativeState()` on every one of these bumps — the
* `indeterminate` DOM property has no attribute form and cannot travel in
* a prop bag, so the render loop, not just the change handler, must own
* it (`checkbox.spec.md`'s "Connector differences").
*/
readonly version: WritableSignal<number>;
/** Starts the underlying service and runs `activateCheckbox` (idempotent) — call from the browser only. */
start(): void;
/** Stops the underlying service and releases `activateCheckbox`'s cleanup (idempotent). */
stop(): void;
/** Forwards a new committed input to the machine (no-op on the very first call). */
sync(input: CheckboxInput): void;
/**
* Updates the connector's live `name`/`value`/`required`/`ariaLabel`
* reading (see `use-checkbox.ts`'s header comment for why this exists
* instead of a one-shot constructor-time value).
*/
setConnectOptions(next: CheckboxConnectOptionsPatch): void;
}
Name
Kind
Type
Requirement
Description
connector
property
CheckboxApi
required
scope
property
PartScope
required
service
property
CheckboxService
required
setConnectOptions
method
(next: CheckboxConnectOptionsPatch) => void
required
Updates the connector's live `name`/`value`/`required`/`ariaLabel` reading (see `use-checkbox.ts`'s header comment for why this exists instead of a one-shot constructor-time value).
start
method
() => void
required
Starts the underlying service and runs `activateCheckbox` (idempotent) — call from the browser only.
stop
method
() => void
required
Stops the underlying service and releases `activateCheckbox`'s cleanup (idempotent).
sync
method
(input: CheckboxInput) => void
required
Forwards a new committed input to the machine (no-op on the very first call).
version
property
WritableSignal<number>
required
Bumped on every committed machine update — AND, defensively, once by `GrCheckboxLabel`/`GrCheckboxDescription` right after they self-register (see `parts.ts`). Effects that read the connector's prop bags must read this signal first — inside the same `effect()` — so Angular's reactivity re-runs the effect on every committed change, AND so `GrCheckboxHiddenInput`'s `aria-labelledby`/`aria-describedby` (resolved from `scope.get("label"/"description")` at getter-call time) settle once those parts exist. `GrCheckboxHiddenInput`'s effect also calls `connector.syncNativeState()` on every one of these bumps — the `indeterminate` DOM property has no attribute form and cannot travel in a prop bag, so the render loop, not just the change handler, must own it (`checkbox.spec.md`'s "Connector differences").
Name
connector
Kind
property
Type
CheckboxApi
Requirement
required
Description
Name
scope
Kind
property
Type
PartScope
Requirement
required
Description
Name
service
Kind
property
Type
CheckboxService
Requirement
required
Description
Name
setConnectOptions
Kind
method
Type
(next: CheckboxConnectOptionsPatch) => void
Requirement
required
Description
Updates the connector's live `name`/`value`/`required`/`ariaLabel` reading (see `use-checkbox.ts`'s header comment for why this exists instead of a one-shot constructor-time value).
Name
start
Kind
method
Type
() => void
Requirement
required
Description
Starts the underlying service and runs `activateCheckbox` (idempotent) — call from the browser only.
Name
stop
Kind
method
Type
() => void
Requirement
required
Description
Stops the underlying service and releases `activateCheckbox`'s cleanup (idempotent).
Name
sync
Kind
method
Type
(input: CheckboxInput) => void
Requirement
required
Description
Forwards a new committed input to the machine (no-op on the very first call).
Name
version
Kind
property
Type
WritableSignal<number>
Requirement
required
Description
Bumped on every committed machine update — AND, defensively, once by `GrCheckboxLabel`/`GrCheckboxDescription` right after they self-register (see `parts.ts`). Effects that read the connector's prop bags must read this signal first — inside the same `effect()` — so Angular's reactivity re-runs the effect on every committed change, AND so `GrCheckboxHiddenInput`'s `aria-labelledby`/`aria-describedby` (resolved from `scope.get("label"/"description")` at getter-call time) settle once those parts exist. `GrCheckboxHiddenInput`'s effect also calls `connector.syncNativeState()` on every one of these bumps — the `indeterminate` DOM property has no attribute form and cannot travel in a prop bag, so the render loop, not just the change handler, must own it (`checkbox.spec.md`'s "Connector differences").
DeclarationView source
createCheckboxStorets
export declare function createCheckboxStore(initialInput: CheckboxInput, options?: CreateCheckboxStoreOptions): CheckboxStore;
Name
Kind
Type
Requirement
initialInput
parameter
CheckboxInput
required
options
parameter
CreateCheckboxStoreOptions
optional
return
return value
CheckboxStore
n/a
Name
initialInput
Kind
parameter
Type
CheckboxInput
Requirement
required
Name
options
Kind
parameter
Type
CreateCheckboxStoreOptions
Requirement
optional
Name
return
Kind
return value
Type
CheckboxStore
Requirement
n/a
DeclarationView source
CreateCheckboxStoreOptionsts
export interface CreateCheckboxStoreOptions {
readonly onCheckedChange?: (detail: CheckboxChangeDetail) => void;
readonly onChange?: (event: unknown) => void;
readonly onCommit?: () => void;
readonly id?: string;
}
Name
Kind
Type
Requirement
id
property
string
optional
onChange
property
(event: unknown) => void
optional
onCheckedChange
property
(detail: CheckboxChangeDetail) => void
optional
onCommit
property
() => void
optional
Name
id
Kind
property
Type
string
Requirement
optional
Name
onChange
Kind
property
Type
(event: unknown) => void
Requirement
optional
Name
onCheckedChange
Kind
property
Type
(detail: CheckboxChangeDetail) => void
Requirement
optional
Name
onCommit
Kind
property
Type
() => void
Requirement
optional
DeclarationView source
GR_CHECKBOX_DECLARATIONSts
export declare const GR_CHECKBOX_DECLARATIONS: readonly [typeof GrCheckboxRoot, typeof GrCheckboxRootProvider, typeof GrCheckboxHiddenInput, typeof GrCheckboxControl, typeof GrCheckboxIndicator, typeof GrCheckboxLabel, typeof GrCheckboxDescription];
DeclarationView source
GrCheckboxControlts
export declare class GrCheckboxControl implements OnDestroy {
private readonly store;
private readonly elementRef;
private readonly listeners;
private readonly consumerProps;
constructor();
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<GrCheckboxControl, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<GrCheckboxControl, "[grCheckboxControl]", never, {}, {}, never, never, true, never>;
}
Name
Kind
Type
Requirement
consumerProps
property
any
required
elementRef
property
any
required
listeners
property
any
required
ngOnDestroy
method
() => void
required
ɵdir
property
i0.ɵɵDirectiveDeclaration<GrCheckboxControl, "[grCheckboxControl]", never, {}, {}, never, never, true, never>
required
ɵfac
property
i0.ɵɵFactoryDeclaration<GrCheckboxControl, never>
required
store
property
any
required
Name
consumerProps
Kind
property
Type
any
Requirement
required
Name
elementRef
Kind
property
Type
any
Requirement
required
Name
listeners
Kind
property
Type
any
Requirement
required
Name
ngOnDestroy
Kind
method
Type
() => void
Requirement
required
Name
ɵdir
Kind
property
Type
i0.ɵɵDirectiveDeclaration<GrCheckboxControl, "[grCheckboxControl]", never, {}, {}, never, never, true, never>
Requirement
required
Name
ɵfac
Kind
property
Type
i0.ɵɵFactoryDeclaration<GrCheckboxControl, never>
Requirement
required
Name
store
Kind
property
Type
any
Requirement
required
DeclarationView source
GrCheckboxDescriptionts
export declare class GrCheckboxDescription implements OnDestroy {
private readonly store;
private readonly elementRef;
private readonly listeners;
private readonly consumerProps;
constructor();
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<GrCheckboxDescription, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<GrCheckboxDescription, "[grCheckboxDescription]", never, {}, {}, never, never, true, never>;
}
Name
Kind
Type
Requirement
consumerProps
property
any
required
elementRef
property
any
required
listeners
property
any
required
ngOnDestroy
method
() => void
required
ɵdir
property
i0.ɵɵDirectiveDeclaration<GrCheckboxDescription, "[grCheckboxDescription]", never, {}, {}, never, never, true, never>
required
ɵfac
property
i0.ɵɵFactoryDeclaration<GrCheckboxDescription, never>
required
store
property
any
required
Name
consumerProps
Kind
property
Type
any
Requirement
required
Name
elementRef
Kind
property
Type
any
Requirement
required
Name
listeners
Kind
property
Type
any
Requirement
required
Name
ngOnDestroy
Kind
method
Type
() => void
Requirement
required
Name
ɵdir
Kind
property
Type
i0.ɵɵDirectiveDeclaration<GrCheckboxDescription, "[grCheckboxDescription]", never, {}, {}, never, never, true, never>
Requirement
required
Name
ɵfac
Kind
property
Type
i0.ɵɵFactoryDeclaration<GrCheckboxDescription, never>
Requirement
required
Name
store
Kind
property
Type
any
Requirement
required
DeclarationView source
GrCheckboxHiddenInputts
export declare class GrCheckboxHiddenInput implements OnDestroy {
private readonly store;
private readonly elementRef;
private readonly listeners;
private readonly consumerProps;
constructor();
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<GrCheckboxHiddenInput, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<GrCheckboxHiddenInput, "input[grCheckboxHiddenInput]", never, {}, {}, never, never, true, never>;
}
Name
Kind
Type
Requirement
consumerProps
property
any
required
elementRef
property
any
required
listeners
property
any
required
ngOnDestroy
method
() => void
required
ɵdir
property
i0.ɵɵDirectiveDeclaration<GrCheckboxHiddenInput, "input[grCheckboxHiddenInput]", never, {}, {}, never, never, true, never>
required
ɵfac
property
i0.ɵɵFactoryDeclaration<GrCheckboxHiddenInput, never>
required
store
property
any
required
Name
consumerProps
Kind
property
Type
any
Requirement
required
Name
elementRef
Kind
property
Type
any
Requirement
required
Name
listeners
Kind
property
Type
any
Requirement
required
Name
ngOnDestroy
Kind
method
Type
() => void
Requirement
required
Name
ɵdir
Kind
property
Type
i0.ɵɵDirectiveDeclaration<GrCheckboxHiddenInput, "input[grCheckboxHiddenInput]", never, {}, {}, never, never, true, never>
Requirement
required
Name
ɵfac
Kind
property
Type
i0.ɵɵFactoryDeclaration<GrCheckboxHiddenInput, never>
Requirement
required
Name
store
Kind
property
Type
any
Requirement
required
DeclarationView source
GrCheckboxIndicatorts
export declare class GrCheckboxIndicator implements OnDestroy {
private readonly store;
private readonly elementRef;
private readonly listeners;
private readonly consumerProps;
constructor();
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<GrCheckboxIndicator, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<GrCheckboxIndicator, "[grCheckboxIndicator]", never, {}, {}, never, never, true, never>;
}
Name
Kind
Type
Requirement
consumerProps
property
any
required
elementRef
property
any
required
listeners
property
any
required
ngOnDestroy
method
() => void
required
ɵdir
property
i0.ɵɵDirectiveDeclaration<GrCheckboxIndicator, "[grCheckboxIndicator]", never, {}, {}, never, never, true, never>
required
ɵfac
property
i0.ɵɵFactoryDeclaration<GrCheckboxIndicator, never>
required
store
property
any
required
Name
consumerProps
Kind
property
Type
any
Requirement
required
Name
elementRef
Kind
property
Type
any
Requirement
required
Name
listeners
Kind
property
Type
any
Requirement
required
Name
ngOnDestroy
Kind
method
Type
() => void
Requirement
required
Name
ɵdir
Kind
property
Type
i0.ɵɵDirectiveDeclaration<GrCheckboxIndicator, "[grCheckboxIndicator]", never, {}, {}, never, never, true, never>
Requirement
required
Name
ɵfac
Kind
property
Type
i0.ɵɵFactoryDeclaration<GrCheckboxIndicator, never>
Requirement
required
Name
store
Kind
property
Type
any
Requirement
required
DeclarationView source
GrCheckboxLabelts
export declare class GrCheckboxLabel implements OnDestroy {
private readonly store;
private readonly elementRef;
private readonly listeners;
private readonly consumerProps;
constructor();
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<GrCheckboxLabel, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<GrCheckboxLabel, "[grCheckboxLabel]", never, {}, {}, never, never, true, never>;
}
Name
Kind
Type
Requirement
consumerProps
property
any
required
elementRef
property
any
required
listeners
property
any
required
ngOnDestroy
method
() => void
required
ɵdir
property
i0.ɵɵDirectiveDeclaration<GrCheckboxLabel, "[grCheckboxLabel]", never, {}, {}, never, never, true, never>
required
ɵfac
property
i0.ɵɵFactoryDeclaration<GrCheckboxLabel, never>
required
store
property
any
required
Name
consumerProps
Kind
property
Type
any
Requirement
required
Name
elementRef
Kind
property
Type
any
Requirement
required
Name
listeners
Kind
property
Type
any
Requirement
required
Name
ngOnDestroy
Kind
method
Type
() => void
Requirement
required
Name
ɵdir
Kind
property
Type
i0.ɵɵDirectiveDeclaration<GrCheckboxLabel, "[grCheckboxLabel]", never, {}, {}, never, never, true, never>
Requirement
required
Name
ɵfac
Kind
property
Type
i0.ɵɵFactoryDeclaration<GrCheckboxLabel, never>
Requirement
required
Name
store
Kind
property
Type
any
Requirement
required
DeclarationView source
GrCheckboxRootts
export declare class GrCheckboxRoot implements OnDestroy {
readonly checked: import("@angular/core").InputSignal<import("@grassroot/ui-machines/checkbox").CheckboxCheckedValue | undefined>;
readonly defaultChecked: import("@angular/core").InputSignal<import("@grassroot/ui-machines/checkbox").CheckboxCheckedValue | undefined>;
readonly disabled: import("@angular/core").InputSignal<boolean | undefined>;
readonly readOnly: import("@angular/core").InputSignal<boolean | undefined>;
readonly name: import("@angular/core").InputSignal<string | undefined>;
readonly value: import("@angular/core").InputSignal<string | undefined>;
readonly required: import("@angular/core").InputSignal<boolean | undefined>;
/** Accessible-name escape hatch [inherited from Switch's baseline #17] — see `GrCheckboxLabel` for the primary path. */
readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
/**
* Seeds the part scope INSTEAD of the generated id when supplied
* [inherited from Switch's baseline #10]: `<gr-checkbox-root id="terms">`
* yields deterministic `hidden-input`/`label`/`description` ids derived
* from `"terms"`. Feeds `createCheckboxStore`'s `id` option
* (constructor-only — see that function's doc comment); read once, in the
* constructor below, unlike `name`/`value`/`required`/`ariaLabel`, which
* stay live via `setConnectOptions()`.
*/
readonly id: import("@angular/core").InputSignal<string | undefined>;
readonly checkedChange: import("@angular/core").OutputEmitterRef<CheckboxChangeDetail>;
private readonly hostElementRef;
private readonly injector;
private readonly listeners;
private lastSynced;
readonly store: CheckboxStore;
private rootElement;
constructor();
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<GrCheckboxRoot, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<GrCheckboxRoot, "gr-checkbox-root", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; }, never, ["*"], true, never>;
}
Name
Kind
Type
Requirement
Description
ariaLabel
property
import("@angular/core").InputSignal<string | undefined>
required
Accessible-name escape hatch [inherited from Switch's baseline #17] — see `GrCheckboxLabel` for the primary path.
checked
property
import("@angular/core").InputSignal<import("@grassroot/ui-machines/checkbox").CheckboxCheckedValue | undefined>
required
checkedChange
property
import("@angular/core").OutputEmitterRef<CheckboxChangeDetail>
required
defaultChecked
property
import("@angular/core").InputSignal<import("@grassroot/ui-machines/checkbox").CheckboxCheckedValue | undefined>
required
disabled
property
import("@angular/core").InputSignal<boolean | undefined>
required
hostElementRef
property
any
required
id
property
import("@angular/core").InputSignal<string | undefined>
required
Seeds the part scope INSTEAD of the generated id when supplied [inherited from Switch's baseline #10]: `<gr-checkbox-root id="terms">` yields deterministic `hidden-input`/`label`/`description` ids derived from `"terms"`. Feeds `createCheckboxStore`'s `id` option (constructor-only — see that function's doc comment); read once, in the constructor below, unlike `name`/`value`/`required`/`ariaLabel`, which stay live via `setConnectOptions()`.
injector
property
any
required
lastSynced
property
any
required
listeners
property
any
required
name
property
import("@angular/core").InputSignal<string | undefined>
required
ngOnDestroy
method
() => void
required
ɵcmp
property
i0.ɵɵComponentDeclaration<GrCheckboxRoot, "gr-checkbox-root", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; }, never, ["*"], true, never>
required
ɵfac
property
i0.ɵɵFactoryDeclaration<GrCheckboxRoot, never>
required
Name
ariaLabel
Kind
property
Type
import("@angular/core").InputSignal<string | undefined>
Requirement
required
Description
Accessible-name escape hatch [inherited from Switch's baseline #17] — see `GrCheckboxLabel` for the primary path.
Name
checked
Kind
property
Type
import("@angular/core").InputSignal<import("@grassroot/ui-machines/checkbox").CheckboxCheckedValue | undefined>
Requirement
required
Description
Name
checkedChange
Kind
property
Type
import("@angular/core").OutputEmitterRef<CheckboxChangeDetail>
Requirement
required
Description
Name
defaultChecked
Kind
property
Type
import("@angular/core").InputSignal<import("@grassroot/ui-machines/checkbox").CheckboxCheckedValue | undefined>
Requirement
required
Description
Name
disabled
Kind
property
Type
import("@angular/core").InputSignal<boolean | undefined>
Requirement
required
Description
Name
hostElementRef
Kind
property
Type
any
Requirement
required
Description
Name
id
Kind
property
Type
import("@angular/core").InputSignal<string | undefined>
Requirement
required
Description
Seeds the part scope INSTEAD of the generated id when supplied [inherited from Switch's baseline #10]: `<gr-checkbox-root id="terms">` yields deterministic `hidden-input`/`label`/`description` ids derived from `"terms"`. Feeds `createCheckboxStore`'s `id` option (constructor-only — see that function's doc comment); read once, in the constructor below, unlike `name`/`value`/`required`/`ariaLabel`, which stay live via `setConnectOptions()`.
Name
injector
Kind
property
Type
any
Requirement
required
Description
Name
lastSynced
Kind
property
Type
any
Requirement
required
Description
Name
listeners
Kind
property
Type
any
Requirement
required
Description
Name
name
Kind
property
Type
import("@angular/core").InputSignal<string | undefined>
Requirement
required
Description
Name
ngOnDestroy
Kind
method
Type
() => void
Requirement
required
Description
Name
ɵcmp
Kind
property
Type
i0.ɵɵComponentDeclaration<GrCheckboxRoot, "gr-checkbox-root", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; }, never, ["*"], true, never>
Requirement
required
Description
Name
ɵfac
Kind
property
Type
i0.ɵɵFactoryDeclaration<GrCheckboxRoot, never>
Requirement
required
Description
Name
readOnly
Kind
property
Type
import("@angular/core").InputSignal<boolean | undefined>
Requirement
required
Description
Name
required
Kind
property
Type
import("@angular/core").InputSignal<boolean | undefined>
Requirement
required
Description
Name
rootElement
Kind
property
Type
any
Requirement
required
Description
Name
store
Kind
property
Type
CheckboxStore
Requirement
required
Description
Name
value
Kind
property
Type
import("@angular/core").InputSignal<string | undefined>
Requirement
required
Description
DeclarationView source
GrCheckboxRootProviderts
export declare class GrCheckboxRootProvider implements OnDestroy {
private readonly hostElementRef;
private readonly injector;
private readonly listeners;
readonly store: CheckboxStore;
private rootElement;
constructor();
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<GrCheckboxRootProvider, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<GrCheckboxRootProvider, "gr-checkbox-root-provider", never, {}, {}, never, ["*"], true, never>;
}
Name
Kind
Type
Requirement
hostElementRef
property
any
required
injector
property
any
required
listeners
property
any
required
ngOnDestroy
method
() => void
required
ɵcmp
property
i0.ɵɵComponentDeclaration<GrCheckboxRootProvider, "gr-checkbox-root-provider", never, {}, {}, never, ["*"], true, never>
required
ɵfac
property
i0.ɵɵFactoryDeclaration<GrCheckboxRootProvider, never>
required
rootElement
property
any
required
store
property
CheckboxStore
required
Name
hostElementRef
Kind
property
Type
any
Requirement
required
Name
injector
Kind
property
Type
any
Requirement
required
Name
listeners
Kind
property
Type
any
Requirement
required
Name
ngOnDestroy
Kind
method
Type
() => void
Requirement
required
Name
ɵcmp
Kind
property
Type
i0.ɵɵComponentDeclaration<GrCheckboxRootProvider, "gr-checkbox-root-provider", never, {}, {}, never, ["*"], true, never>
Requirement
required
Name
ɵfac
Kind
property
Type
i0.ɵɵFactoryDeclaration<GrCheckboxRootProvider, never>
Requirement
required
Name
rootElement
Kind
property
Type
any
Requirement
required
Name
store
Kind
property
Type
CheckboxStore
Requirement
required
DeclarationView source
provideCheckboxStorets
export declare function provideCheckboxStore(initialInput?: CheckboxInput, options?: CreateCheckboxStoreOptions): Provider;
Name
Kind
Type
Requirement
initialInput
parameter
CheckboxInput
optional
options
parameter
CreateCheckboxStoreOptions
optional
return
return value
Provider
n/a
Name
initialInput
Kind
parameter
Type
CheckboxInput
Requirement
optional
Name
options
Kind
parameter
Type
CreateCheckboxStoreOptions
Requirement
optional
Name
return
Kind
return value
Type
Provider
Requirement
n/a

@grassroot/ui-headless-svelte/checkbox

Svelte adapter

21 exports
View source packages/ui-headless/svelte/src/checkbox/index.ts
DeclarationView source
CheckboxChangeDetailts
interface CheckboxChangeDetail {
readonly checked: boolean;
readonly reason: CheckboxReason;
}
Name
Kind
Type
Requirement
checked
property
boolean
required
reason
property
CheckboxReason
required
Name
checked
Kind
property
Type
boolean
Requirement
required
Name
reason
Kind
property
Type
CheckboxReason
Requirement
required
DeclarationView source
CheckboxCheckedValuets
type CheckboxCheckedValue = boolean | "indeterminate";
DeclarationView source
CheckboxCommandts
type CheckboxCommand = CommandObject & {
readonly type: "CHECKED_CHANGE_REQUEST";
readonly checked: boolean;
readonly reason: CheckboxReason;
};
Name
Kind
Type
Requirement
checked
property
boolean
required
reason
property
CheckboxReason
required
type
property
string
required
Name
checked
Kind
property
Type
boolean
Requirement
required
Name
reason
Kind
property
Type
CheckboxReason
Requirement
required
Name
type
Kind
property
Type
string
Requirement
required
DeclarationView source
CheckboxContextts
type CheckboxContext = {
readonly mode: BindingMode;
};
Name
Kind
Type
Requirement
mode
property
BindingMode
required
Name
mode
Kind
property
Type
BindingMode
Requirement
required
DeclarationView source
CheckboxContextValuets
export interface CheckboxContextValue {
readonly service: CheckboxService;
readonly connector: CheckboxApi;
readonly scope: PartScope;
/**
* Bumped on every committed machine update. Parts must read this
* (`ctx.version()`) *inside* the `$derived` that computes their prop
* bag — not once at setup — so Svelte's fine-grained reactivity tracks
* the dependency and recomputes on every committed change (mirrors the
* Switch adapter's equivalent staleness fix).
*/
readonly version: () => number;
}
Name
Kind
Type
Requirement
Description
connector
property
CheckboxApi
required
scope
property
PartScope
required
service
property
CheckboxService
required
version
property
() => number
required
Bumped on every committed machine update. Parts must read this (`ctx.version()`) *inside* the `$derived` that computes their prop bag — not once at setup — so Svelte's fine-grained reactivity tracks the dependency and recomputes on every committed change (mirrors the Switch adapter's equivalent staleness fix).
Name
connector
Kind
property
Type
CheckboxApi
Requirement
required
Description
Name
scope
Kind
property
Type
PartScope
Requirement
required
Description
Name
service
Kind
property
Type
CheckboxService
Requirement
required
Description
Name
version
Kind
property
Type
() => number
Requirement
required
Description
Bumped on every committed machine update. Parts must read this (`ctx.version()`) *inside* the `$derived` that computes their prop bag — not once at setup — so Svelte's fine-grained reactivity tracks the dependency and recomputes on every committed change (mirrors the Switch adapter's equivalent staleness fix).
DeclarationView source
CheckboxControlts
export declare const CheckboxControl: LegacyComponentType;
Name
Kind
Type
Requirement
args
parameter
Parameters<Component<Record<string, any>>>
optional
return
return value
ReturnType<Component<Record<string, any>, Record<string, any>>>
n/a
Name
args
Kind
parameter
Type
Parameters<Component<Record<string, any>>>
Requirement
optional
Name
return
Kind
return value
Type
ReturnType<Component<Record<string, any>, Record<string, any>>>
Requirement
n/a
DeclarationView source
CheckboxDescriptionts
export declare const CheckboxDescription: LegacyComponentType;
Name
Kind
Type
Requirement
args
parameter
Parameters<Component<Record<string, any>>>
optional
return
return value
ReturnType<Component<Record<string, any>, Record<string, any>>>
n/a
Name
args
Kind
parameter
Type
Parameters<Component<Record<string, any>>>
Requirement
optional
Name
return
Kind
return value
Type
ReturnType<Component<Record<string, any>, Record<string, any>>>
Requirement
n/a
DeclarationView source
CheckboxEventts
type CheckboxEvent = {
readonly type: "TOGGLE";
readonly reason: CheckboxReason;
} | {
readonly type: "RESET";
};
DeclarationView source
CheckboxHiddenInputts
export declare const CheckboxHiddenInput: LegacyComponentType;
Name
Kind
Type
Requirement
args
parameter
Parameters<Component<Record<string, any>>>
optional
return
return value
ReturnType<Component<Record<string, any>, Record<string, any>>>
n/a
Name
args
Kind
parameter
Type
Parameters<Component<Record<string, any>>>
Requirement
optional
Name
return
Kind
return value
Type
ReturnType<Component<Record<string, any>, Record<string, any>>>
Requirement
n/a
DeclarationView source
CheckboxIndicatorts
export declare const CheckboxIndicator: LegacyComponentType;
Name
Kind
Type
Requirement
args
parameter
Parameters<Component<Record<string, any>>>
optional
return
return value
ReturnType<Component<Record<string, any>, Record<string, any>>>
n/a
Name
args
Kind
parameter
Type
Parameters<Component<Record<string, any>>>
Requirement
optional
Name
return
Kind
return value
Type
ReturnType<Component<Record<string, any>, Record<string, any>>>
Requirement
n/a
DeclarationView source
CheckboxInputts
type CheckboxInput = {
readonly checked?: CheckboxCheckedValue;
readonly defaultChecked?: CheckboxCheckedValue;
readonly disabled?: boolean;
readonly readOnly?: boolean;
};
Name
Kind
Type
Requirement
checked
property
CheckboxCheckedValue
optional
defaultChecked
property
CheckboxCheckedValue
optional
disabled
property
boolean
optional
readOnly
property
boolean
optional
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
DeclarationView source
CheckboxLabelts
export declare const CheckboxLabel: LegacyComponentType;
Name
Kind
Type
Requirement
args
parameter
Parameters<Component<Record<string, any>>>
optional
return
return value
ReturnType<Component<Record<string, any>, Record<string, any>>>
n/a
Name
args
Kind
parameter
Type
Parameters<Component<Record<string, any>>>
Requirement
optional
Name
return
Kind
return value
Type
ReturnType<Component<Record<string, any>, Record<string, any>>>
Requirement
n/a
DeclarationView source
CheckboxReasonts
type CheckboxReason = "pointer" | "keyboard" | "programmatic";

CheckboxRoot

value
DeclarationView source
CheckboxRootts
export declare const CheckboxRoot: LegacyComponentType;
Name
Kind
Type
Requirement
args
parameter
Parameters<Component<Record<string, any>>>
optional
return
return value
ReturnType<Component<Record<string, any>, Record<string, any>>>
n/a
Name
args
Kind
parameter
Type
Parameters<Component<Record<string, any>>>
Requirement
optional
Name
return
Kind
return value
Type
ReturnType<Component<Record<string, any>, Record<string, any>>>
Requirement
n/a
DeclarationView source
CheckboxRootProviderts
export declare const CheckboxRootProvider: LegacyComponentType;
Name
Kind
Type
Requirement
args
parameter
Parameters<Component<Record<string, any>>>
optional
return
return value
ReturnType<Component<Record<string, any>, Record<string, any>>>
n/a
Name
args
Kind
parameter
Type
Parameters<Component<Record<string, any>>>
Requirement
optional
Name
return
Kind
return value
Type
ReturnType<Component<Record<string, any>, Record<string, any>>>
Requirement
n/a
DeclarationView source
CheckboxSnapshotts
type CheckboxSnapshot = Snapshot<CheckboxValue, CheckboxContext>;
DeclarationView source
CheckboxValuets
type CheckboxValue = "unchecked" | "checked" | "indeterminate";

createCheckbox

function
DeclarationView source
createCheckboxts
export declare function createCheckbox(inputGetter: () => CheckboxInput, optionsGetter?: () => UseCheckboxOptions): UseCheckboxResult;
Name
Kind
Type
Requirement
inputGetter
parameter
() => CheckboxInput
required
optionsGetter
parameter
() => UseCheckboxOptions
optional
return
return value
UseCheckboxResult
n/a
Name
inputGetter
Kind
parameter
Type
() => CheckboxInput
Requirement
required
Name
optionsGetter
Kind
parameter
Type
() => UseCheckboxOptions
Requirement
optional
Name
return
Kind
return value
Type
UseCheckboxResult
Requirement
n/a
DeclarationView source
useCheckboxContextts
export declare function useCheckboxContext(partName: string): CheckboxContextValue;
Name
Kind
Type
Requirement
partName
parameter
string
required
return
return value
CheckboxContextValue
n/a
Name
partName
Kind
parameter
Type
string
Requirement
required
Name
return
Kind
return value
Type
CheckboxContextValue
Requirement
n/a

UseCheckboxOptions

interface
DeclarationView source
UseCheckboxOptionsts
export interface UseCheckboxOptions {
readonly onCheckedChange?: (detail: CheckboxChangeDetail) => void;
readonly onChange?: (event: Event) => void;
readonly name?: string;
readonly value?: string;
readonly required?: boolean;
readonly ariaLabel?: string;
readonly id?: string;
}
Name
Kind
Type
Requirement
ariaLabel
property
string
optional
id
property
string
optional
name
property
string
optional
onChange
property
(event: Event) => void
optional
onCheckedChange
property
(detail: CheckboxChangeDetail) => void
optional
required
property
boolean
optional
value
property
string
optional
Name
ariaLabel
Kind
property
Type
string
Requirement
optional
Name
id
Kind
property
Type
string
Requirement
optional
Name
name
Kind
property
Type
string
Requirement
optional
Name
onChange
Kind
property
Type
(event: Event) => void
Requirement
optional
Name
onCheckedChange
Kind
property
Type
(detail: CheckboxChangeDetail) => void
Requirement
optional
Name
required
Kind
property
Type
boolean
Requirement
optional
Name
value
Kind
property
Type
string
Requirement
optional

UseCheckboxResult

interface
DeclarationView source
UseCheckboxResultts
export interface UseCheckboxResult {
readonly service: CheckboxService;
readonly connector: CheckboxApi;
readonly scope: PartScope;
readonly version: () => number;
}
Name
Kind
Type
Requirement
connector
property
CheckboxApi
required
scope
property
PartScope
required
service
property
CheckboxService
required
version
property
() => number
required
Name
connector
Kind
property
Type
CheckboxApi
Requirement
required
Name
scope
Kind
property
Type
PartScope
Requirement
required
Name
service
Kind
property
Type
CheckboxService
Requirement
required
Name
version
Kind
property
Type
() => number
Requirement
required

@grassroot/ui-headless-solid/checkbox

Solid adapter

18 exports
View source packages/ui-headless/solid/src/checkbox/index.ts
DeclarationView source
CheckboxConnectConfigts
export interface CheckboxConnectConfig {
readonly name?: string;
readonly value?: string;
readonly required?: boolean;
readonly ariaLabel?: string;
}
Name
Kind
Type
Requirement
ariaLabel
property
string
optional
name
property
string
optional
required
property
boolean
optional
value
property
string
optional
Name
ariaLabel
Kind
property
Type
string
Requirement
optional
Name
name
Kind
property
Type
string
Requirement
optional
Name
required
Kind
property
Type
boolean
Requirement
optional
Name
value
Kind
property
Type
string
Requirement
optional
DeclarationView source
CheckboxContextts
export declare const CheckboxContext: import("solid-js").Context<CheckboxContextValue | undefined>;
DeclarationView source
CheckboxContextValuets
export interface CheckboxContextValue {
readonly service: CheckboxService;
readonly connector: CheckboxApi;
readonly scope: PartScope;
/**
* Bumped on every committed machine update. Parts must call this
* accessor *inside* the JSX/spread thunk that reads the connector's prop
* bags — not once at setup — so Solid's fine-grained reactivity tracks
* the dependency and re-runs on every committed change.
*/
readonly snapshot: Accessor<CheckboxSnapshot>;
/**
* Solid-adapter-internal: `CheckboxHiddenInput` reads this alongside
* `snapshot()` to resettle `aria-labelledby`/`aria-describedby` once
* `CheckboxLabel`/`CheckboxDescription` (if rendered) have registered,
* and to pick up `name`/`value`/`required`/`ariaLabel` changes — see
* `use-checkbox.ts`'s `relationshipTick` header comment.
*/
readonly relationshipTick: Accessor<number>;
}
Name
Kind
Type
Requirement
Description
connector
property
CheckboxApi
required
relationshipTick
property
Accessor<number>
required
Solid-adapter-internal: `CheckboxHiddenInput` reads this alongside `snapshot()` to resettle `aria-labelledby`/`aria-describedby` once `CheckboxLabel`/`CheckboxDescription` (if rendered) have registered, and to pick up `name`/`value`/`required`/`ariaLabel` changes — see `use-checkbox.ts`'s `relationshipTick` header comment.
scope
property
PartScope
required
service
property
CheckboxService
required
snapshot
property
Accessor<CheckboxSnapshot>
required
Bumped on every committed machine update. Parts must call this accessor *inside* the JSX/spread thunk that reads the connector's prop bags — not once at setup — so Solid's fine-grained reactivity tracks the dependency and re-runs on every committed change.
Name
connector
Kind
property
Type
CheckboxApi
Requirement
required
Description
Name
relationshipTick
Kind
property
Type
Accessor<number>
Requirement
required
Description
Solid-adapter-internal: `CheckboxHiddenInput` reads this alongside `snapshot()` to resettle `aria-labelledby`/`aria-describedby` once `CheckboxLabel`/`CheckboxDescription` (if rendered) have registered, and to pick up `name`/`value`/`required`/`ariaLabel` changes — see `use-checkbox.ts`'s `relationshipTick` header comment.
Name
scope
Kind
property
Type
PartScope
Requirement
required
Description
Name
service
Kind
property
Type
CheckboxService
Requirement
required
Description
Name
snapshot
Kind
property
Type
Accessor<CheckboxSnapshot>
Requirement
required
Description
Bumped on every committed machine update. Parts must call this accessor *inside* the JSX/spread thunk that reads the connector's prop bags — not once at setup — so Solid's fine-grained reactivity tracks the dependency and re-runs on every committed change.
DeclarationView source
CheckboxControlts
export declare const CheckboxControl: (props: CheckboxPartProps) => JSX.Element;
Name
Kind
Type
Requirement
props
parameter
CheckboxPartProps
required
return
return value
JSX.Element
n/a
Name
props
Kind
parameter
Type
CheckboxPartProps
Requirement
required
Name
return
Kind
return value
Type
JSX.Element
Requirement
n/a
DeclarationView source
CheckboxDescriptionts
export declare const CheckboxDescription: (props: CheckboxPartProps) => JSX.Element;
Name
Kind
Type
Requirement
props
parameter
CheckboxPartProps
required
return
return value
JSX.Element
n/a
Name
props
Kind
parameter
Type
CheckboxPartProps
Requirement
required
Name
return
Kind
return value
Type
JSX.Element
Requirement
n/a
DeclarationView source
CheckboxHiddenInputts
export declare function CheckboxHiddenInput(props?: CheckboxHiddenInputProps): JSX.Element;
Name
Kind
Type
Requirement
props
parameter
CheckboxHiddenInputProps
optional
return
return value
JSX.Element
n/a
Name
props
Kind
parameter
Type
CheckboxHiddenInputProps
Requirement
optional
Name
return
Kind
return value
Type
JSX.Element
Requirement
n/a
DeclarationView source
CheckboxHiddenInputPropsts
export interface CheckboxHiddenInputProps extends Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "checked" | "disabled" | "onChange"> {
}
DeclarationView source
CheckboxIndicatorts
export declare const CheckboxIndicator: (props: CheckboxPartProps) => JSX.Element;
Name
Kind
Type
Requirement
props
parameter
CheckboxPartProps
required
return
return value
JSX.Element
n/a
Name
props
Kind
parameter
Type
CheckboxPartProps
Requirement
required
Name
return
Kind
return value
Type
JSX.Element
Requirement
n/a
DeclarationView source
CheckboxLabelts
export declare const CheckboxLabel: (props: CheckboxPartProps) => JSX.Element;
Name
Kind
Type
Requirement
props
parameter
CheckboxPartProps
required
return
return value
JSX.Element
n/a
Name
props
Kind
parameter
Type
CheckboxPartProps
Requirement
required
Name
return
Kind
return value
Type
JSX.Element
Requirement
n/a

CheckboxPartProps

interface
DeclarationView source
CheckboxPartPropsts
export interface CheckboxPartProps extends JSX.HTMLAttributes<HTMLSpanElement> {
}

CheckboxRoot

function
DeclarationView source
CheckboxRootts
export declare function CheckboxRoot(props: CheckboxRootProps): JSX.Element;
Name
Kind
Type
Requirement
props
parameter
CheckboxRootProps
required
return
return value
JSX.Element
n/a
Name
props
Kind
parameter
Type
CheckboxRootProps
Requirement
required
Name
return
Kind
return value
Type
JSX.Element
Requirement
n/a

CheckboxRootProps

interface
DeclarationView source
CheckboxRootPropsts
export interface CheckboxRootProps extends Omit<JSX.LabelHTMLAttributes<HTMLLabelElement>, "onChange"> {
readonly checked?: CheckboxInput["checked"];
readonly defaultChecked?: CheckboxInput["defaultChecked"];
readonly disabled?: CheckboxInput["disabled"];
readonly readOnly?: CheckboxInput["readOnly"];
readonly name?: string;
readonly value?: string;
readonly required?: boolean;
/** Accessible-name escape hatch [baseline #17, inherited] — see `CheckboxLabel` for the primary path. */
readonly ariaLabel?: string;
/**
* Seeds the part scope INSTEAD of the generated id when supplied
* [baseline #10, inherited]: `<CheckboxRoot id="terms">` yields
* deterministic `hidden-input`/`label`/`description` ids derived from
* `"terms"`. Feeds `useCheckbox`'s `id` option — see that primitive's doc
* comment. Intercepted here rather than left in the native passthrough,
* so it configures the scope seed instead of landing on the rendered
* `<label>` as a plain HTML `id` attribute.
*/
readonly id?: string;
readonly onCheckedChange?: (detail: CheckboxChangeDetail) => void;
readonly onChange?: (event: Event) => void;
readonly children?: JSX.Element;
}
Name
Kind
Type
Requirement
Description
ariaLabel
property
string
optional
Accessible-name escape hatch [baseline #17, inherited] — see `CheckboxLabel` for the primary path.
checked
property
CheckboxInput["checked"]
optional
children
property
JSX.Element
optional
defaultChecked
property
CheckboxInput["defaultChecked"]
optional
disabled
property
CheckboxInput["disabled"]
optional
id
property
string
optional
Seeds the part scope INSTEAD of the generated id when supplied [baseline #10, inherited]: `<CheckboxRoot id="terms">` yields deterministic `hidden-input`/`label`/`description` ids derived from `"terms"`. Feeds `useCheckbox`'s `id` option — see that primitive's doc comment. Intercepted here rather than left in the native passthrough, so it configures the scope seed instead of landing on the rendered `<label>` as a plain HTML `id` attribute.
name
property
string
optional
onChange
property
(event: Event) => void
optional
onCheckedChange
property
(detail: CheckboxChangeDetail) => void
optional
readOnly
property
CheckboxInput["readOnly"]
optional
required
property
boolean
optional
value
property
string
optional
Name
ariaLabel
Kind
property
Type
string
Requirement
optional
Description
Accessible-name escape hatch [baseline #17, inherited] — see `CheckboxLabel` for the primary path.
Name
checked
Kind
property
Type
CheckboxInput["checked"]
Requirement
optional
Description
Name
children
Kind
property
Type
JSX.Element
Requirement
optional
Description
Name
defaultChecked
Kind
property
Type
CheckboxInput["defaultChecked"]
Requirement
optional
Description
Name
disabled
Kind
property
Type
CheckboxInput["disabled"]
Requirement
optional
Description
Name
id
Kind
property
Type
string
Requirement
optional
Description
Seeds the part scope INSTEAD of the generated id when supplied [baseline #10, inherited]: `<CheckboxRoot id="terms">` yields deterministic `hidden-input`/`label`/`description` ids derived from `"terms"`. Feeds `useCheckbox`'s `id` option — see that primitive's doc comment. Intercepted here rather than left in the native passthrough, so it configures the scope seed instead of landing on the rendered `<label>` as a plain HTML `id` attribute.
Name
name
Kind
property
Type
string
Requirement
optional
Description
Name
onChange
Kind
property
Type
(event: Event) => void
Requirement
optional
Description
Name
onCheckedChange
Kind
property
Type
(detail: CheckboxChangeDetail) => void
Requirement
optional
Description
Name
readOnly
Kind
property
Type
CheckboxInput["readOnly"]
Requirement
optional
Description
Name
required
Kind
property
Type
boolean
Requirement
optional
Description
Name
value
Kind
property
Type
string
Requirement
optional
Description
DeclarationView source
CheckboxRootProviderts
export declare function CheckboxRootProvider(props: CheckboxRootProviderProps): JSX.Element;
Name
Kind
Type
Requirement
props
parameter
CheckboxRootProviderProps
required
return
return value
JSX.Element
n/a
Name
props
Kind
parameter
Type
CheckboxRootProviderProps
Requirement
required
Name
return
Kind
return value
Type
JSX.Element
Requirement
n/a
DeclarationView source
CheckboxRootProviderPropsts
export interface CheckboxRootProviderProps extends Omit<JSX.LabelHTMLAttributes<HTMLLabelElement>, "onChange"> {
/** An existing `useCheckbox()` result (advanced composition) — already fully configured. */
readonly value: UseCheckboxResult;
readonly children?: JSX.Element;
}
Name
Kind
Type
Requirement
Description
children
property
JSX.Element
optional
value
property
UseCheckboxResult
required
An existing `useCheckbox()` result (advanced composition) — already fully configured.
Name
children
Kind
property
Type
JSX.Element
Requirement
optional
Description
Name
value
Kind
property
Type
UseCheckboxResult
Requirement
required
Description
An existing `useCheckbox()` result (advanced composition) — already fully configured.

useCheckbox

function
DeclarationView source
useCheckboxts
export declare function useCheckbox(input: Accessor<CheckboxInput>, connectConfig: Accessor<CheckboxConnectConfig>, options?: UseCheckboxOptions): UseCheckboxResult;
Name
Kind
Type
Requirement
input
parameter
Accessor<CheckboxInput>
required
connectConfig
parameter
Accessor<CheckboxConnectConfig>
required
options
parameter
UseCheckboxOptions
optional
return
return value
UseCheckboxResult
n/a
Name
input
Kind
parameter
Type
Accessor<CheckboxInput>
Requirement
required
Name
connectConfig
Kind
parameter
Type
Accessor<CheckboxConnectConfig>
Requirement
required
Name
options
Kind
parameter
Type
UseCheckboxOptions
Requirement
optional
Name
return
Kind
return value
Type
UseCheckboxResult
Requirement
n/a
DeclarationView source
useCheckboxContextts
export declare function useCheckboxContext(partName: string): CheckboxContextValue;
Name
Kind
Type
Requirement
partName
parameter
string
required
return
return value
CheckboxContextValue
n/a
Name
partName
Kind
parameter
Type
string
Requirement
required
Name
return
Kind
return value
Type
CheckboxContextValue
Requirement
n/a

UseCheckboxOptions

interface
DeclarationView source
UseCheckboxOptionsts
export interface UseCheckboxOptions {
readonly onCheckedChange?: (detail: CheckboxChangeDetail) => void;
readonly onChange?: (event: Event) => void;
readonly id?: string;
}
Name
Kind
Type
Requirement
id
property
string
optional
onChange
property
(event: Event) => void
optional
onCheckedChange
property
(detail: CheckboxChangeDetail) => void
optional
Name
id
Kind
property
Type
string
Requirement
optional
Name
onChange
Kind
property
Type
(event: Event) => void
Requirement
optional
Name
onCheckedChange
Kind
property
Type
(detail: CheckboxChangeDetail) => void
Requirement
optional

UseCheckboxResult

interface
DeclarationView source
UseCheckboxResultts
export interface UseCheckboxResult {
readonly service: CheckboxService;
readonly connector: CheckboxApi;
readonly scope: PartScope;
readonly snapshot: Accessor<CheckboxSnapshot>;
/** Compatibility accessor; registration invalidation is owned by the shared factory snapshot. */
readonly relationshipTick: Accessor<number>;
}
Name
Kind
Type
Requirement
Description
connector
property
CheckboxApi
required
relationshipTick
property
Accessor<number>
required
Compatibility accessor; registration invalidation is owned by the shared factory snapshot.
scope
property
PartScope
required
service
property
CheckboxService
required
snapshot
property
Accessor<CheckboxSnapshot>
required
Name
connector
Kind
property
Type
CheckboxApi
Requirement
required
Description
Name
relationshipTick
Kind
property
Type
Accessor<number>
Requirement
required
Description
Compatibility accessor; registration invalidation is owned by the shared factory snapshot.
Name
scope
Kind
property
Type
PartScope
Requirement
required
Description
Name
service
Kind
property
Type
CheckboxService
Requirement
required
Description
Name
snapshot
Kind
property
Type
Accessor<CheckboxSnapshot>
Requirement
required
Description