Skip to content

Checkbox

Allow users to make binary choices or select multiple options.

import { useState } from 'react';
import {
Checkbox,
type CheckboxState,
} from '@fintech-sandpit/ui/react';
const [value, setValue] = useState<CheckboxState>(false);
return (
<Checkbox
value={value}
onChange={setValue}
>
Accept terms and conditions
</Checkbox>
);
NameTypeDefaultDescription
valueCheckedStatefalseThe controlled state of the checkbox
defaultValueCheckedStatefalseThe default (uncontrolled) checked state of the checkbox
colorSchemeColorSchemeneutralThe checkbox color scheme
sizeSizemdThe checkbox size
variantCheckboxVariantsolidThe checkbox variant
disabledbooleanfalseWhether the checkbox is disabled
invalidbooleanfalseWhether the checkbox is invalid
readOnlybooleanfalseWhether the checkbox is read-only
labelPositionLabelPositionleftThe position of the label
NameTypeDescription
onChange(value: CheckedState) => voidCallback fired when the checked state changes
type CheckboxVariant = 'solid' | 'subtle' | 'outline'
type CheckedState = boolean | 'indeterminate'
type ColorScheme = 'neutral' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger'
type LabelPosition = 'left' | 'right'
type Size = 'xs' | 'sm' | 'md' | 'lg'