Allow users to make binary choices or select multiple options.
import { useState } from 'react';
import { Checkbox } from '@fintech-sandpit/ui/react';
Accept terms and conditions
import { ref } from 'vue';
import { Checkbox } from '@fintech-sandpit/ui/vue';
Accept terms and conditions
| Name | Type | Default | Description |
|---|
checked | CheckedState | — | The controlled checked state of the checkbox |
defaultChecked | CheckedState | false | The default (uncontrolled) checked state of the checkbox |
form | string | — | The id of the checkbox form |
name | string | — | The name of the input field on the form |
value | string | — | The checkbox value for form submission |
colorScheme | ColorScheme | neutral | The checkbox color scheme |
size | Size | md | The checkbox size |
variant | CheckboxVariant | solid | The checkbox variant |
disabled | boolean | false | Whether the checkbox is disabled |
invalid | boolean | false | Whether the checkbox is invalid |
readOnly | boolean | false | Whether the checkbox is read-only |
labelPosition | LabelPosition | left | The position of the label |
| Name | Type | Default | Description |
|---|
checked | CheckedState | — | The controlled state of the checkbox 1 |
default-checked | CheckedState | false | The default (uncontrolled) checked state of the checkbox |
form | string | — | The id of the checkbox form |
name | string | — | The name of the input field on the form |
value | string | — | The checkbox value for form submission |
color-scheme | ColorScheme | neutral | The checkbox color scheme |
size | Size | md | The checkbox size |
variant | CheckboxVariant | solid | The checkbox variant |
disabled | boolean | false | Whether the checkbox is disabled |
invalid | boolean | false | Whether the checkbox is invalid |
read-only | boolean | false | Whether the checkbox is read-only |
label-position | LabelPosition | left | The position of the label |
- Can be used with the
v-model directive for two-way binding.
| Name | Type | Description |
|---|
onCheckedChange | (value: CheckedState) => void | Callback fired when the checked state changes |
| Name | Payload | Description |
|---|
@update:checked | CheckedState | Event emitted 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'