View as Markdown

API reference: @salmonui/inputs/checkbox

CheckboxPropsinterface

import type { CheckboxProps } from '@salmonui/inputs/checkbox';
interface CheckboxProps extends ToggleFieldProps {
    readonly indeterminate?: boolean | undefined;
}
CheckboxProps members (18, 17 inherited)
NameSignatureDescription
checkedoptionalinheritedchecked?: boolean;
defaultCheckedoptionalinheriteddefaultChecked?: boolean;
indeterminateoptionalreadonly indeterminate?: boolean | undefined;

Mixed state: aria-checked="mixed" and data-indeterminate on the server, the DOM property after mount.

descriptionoptionalinheriteddescription?: ReactNode;
errorMessageoptionalinheritederrorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) | ReactNode;

Error text (or a function of the errors) shown while the field is invalid.

invalidoptionalinheritedinvalid?: boolean;

Forces the error state.

validationoptionalinheritedvalidation?: FieldValidation;

Rules in the Data Grid vocabulary.

validateOnoptionalinheritedvalidateOn?: ValidateOn;

When errors appear; default the Form's, else 'blur'.

sizeoptionalinheritedsize?: FieldSize;

Metric set. Default 'md'.

onCheckedChangeoptionalinheritedonCheckedChange?: ((checked: boolean, details: CheckedChangeDetails) => void);
valueoptionalinheritedvalue?: string;

Submitted value when checked (native, default 'on').

childrenoptionalinheritedchildren?: ReactNode;

Label text (rendered in a real <label for>).

labelPlacementoptionalinheritedlabelPlacement?: LabelPlacement;

Label before ('start') or after ('end', default) the control.

localeTextoptionalinheritedlocaleText?: FieldValidationText;
classNameoptionalinheritedclassName?: string;
styleoptionalinheritedstyle?: CSSProperties;
classNamesoptionalinheritedclassNames?: { readonly input?: string; readonly label?: string; readonly description?: string; readonly error?: string; };

Part classes: root is className; input, label, description, error.

refoptionalinheritedref?: Ref<HTMLInputElement>;

The native <input type="checkbox">.