A checkbox component that can be used to trigger actions.
import { Checkbox } from '@backstage/ui';
<Checkbox />
Prop | Type | Default | Responsive |
---|---|---|---|
label | string | - | No |
defaultChecked | boolean'indeterminate' | - | No |
checked | boolean'indeterminate' | - | No |
onChange | (checked: boolean | 'indeterminate') => void | - | No |
disabled | boolean | - | No |
required | boolean | - | No |
name | string | - | No |
value | string | - | No |
className | string | - | No |
style | CSSProperties | - | No |
Here's a view when checkboxes have different variants.
<Inline alignY="center">
<Checkbox />
<Checkbox checked />
<Checkbox label="Checkbox" />
<Checkbox label="Checkbox" checked />
</Inline>
Our theming system is based on a mix between CSS classes, CSS variables and data attributes. If you want to customise this component, you can use one of these class names below.
bui-CheckboxRoot
bui-CheckboxRoot[data-checked="true"]
bui-CheckboxRoot[data-checked="false"]
bui-CheckboxLabel
bui-CheckboxIndicator