Skip to content

Checkbox

Allow users to make binary choices or select multiple options.

import { useState } from 'react';
import { Checkbox } from '@fintech-sandpit/ui/react';
return (
<Checkbox
defaultChecked={false}
disabled={false}
invalid={false}
readOnly={false}
value="accepted"
colorScheme="neutral"
size="md"
variant="solid"
labelPosition="left"
>
Accept terms and conditions
</Checkbox>
);
NameTypeDefaultDescription
checkedCheckedStateThe controlled checked state of the checkbox
defaultCheckedCheckedStatefalseThe default (uncontrolled) checked state of the checkbox
formstringThe id of the checkbox form
namestringThe name of the input field on the form
valuestringThe checkbox value for form submission
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
onCheckedChange(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'