API reference: @salmonui/inputs/checkbox
Checkboxcomponent
import { Checkbox } from '@salmonui/inputs/checkbox';function Checkbox(props: CheckboxProps): ReactNode;
Checkbox on a native <input type="checkbox">,
labelled by its children. Inside a CheckboxGroup it toggles its value
in the group's array. ref is the input; unknown props go to the input,
className / style to the root.
Props: CheckboxProps
| Name | Signature | Description |
|---|---|---|
checkedoptionalinherited | checked?: boolean; | |
defaultCheckedoptionalinherited | defaultChecked?: boolean; | |
indeterminateoptional | readonly indeterminate?: boolean | undefined; | Mixed state: |
descriptionoptionalinherited | description?: ReactNode; | |
errorMessageoptionalinherited | errorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) | ReactNode; | Error text (or a function of the errors) shown while the field is invalid. |
invalidoptionalinherited | invalid?: boolean; | Forces the error state. |
validationoptionalinherited | validation?: FieldValidation; | Rules in the Data Grid vocabulary. |
validateOnoptionalinherited | validateOn?: ValidateOn; | When errors appear; default the |
sizeoptionalinherited | size?: FieldSize; | Metric set. Default |
onCheckedChangeoptionalinherited | onCheckedChange?: ((checked: boolean, details: CheckedChangeDetails) => void); | |
valueoptionalinherited | value?: string; | Submitted value when checked (native, default |
childrenoptionalinherited | children?: ReactNode; | Label text (rendered in a real |
labelPlacementoptionalinherited | labelPlacement?: LabelPlacement; | Label before ( |
localeTextoptionalinherited | localeText?: FieldValidationText; | |
classNameoptionalinherited | className?: string; | |
styleoptionalinherited | style?: CSSProperties; | |
classNamesoptionalinherited | classNames?: { readonly input?: string; readonly label?: string; readonly description?: string; readonly error?: string; }; | Part classes: |
refoptionalinherited | ref?: Ref<HTMLInputElement>; | The native |