Checkbox
Captures binary user input.
Import
Import just the checkbox styles.
@import "@winnie-ui/css/spatial/checkbox";@import "@winnie-ui/css/visual/checkbox";Anatomy
Attach the appropriate data attributes in the structure below.
<button data-component="checkbox"> <i data-slot="indicator"></i></button>Examples
Size
Use the data-size attribute to change the size.
Radius
Use the data-radius attribute to change the radius.
Color
Use the data-accent-color attribute to change the color.
Selected
Use the data-selected attribute to indicate that the checkbox is checked.
Label
Add a label with the label slot attribute as a child of the checkbox.
Description
Add a field component with the description slot attribute as a child to add a description.
Disabled
Use the data-disabled attribute to set the disabled state of checkbox.
Invalid
Checkbox will respect the :invalid selector when it is used in a form. Use the data-invalid attribute to manually control the invalid state of the checkbox.
Reference
checkbox
Groups all of the parts of the checkbox together.