Checkbox
A native, styled checkbox input element.
Props
<Checkbox>
Prop | Type | Default |
---|---|---|
label | Label | Label['html'] | - |
name | string | - |
disabled | boolean | - |
required | boolean | - |
checked | boolean | - |
size | sm | md | lg | - |
color | base | brand | - |
contrast | boolean | - |
as | HTMLTag | div |
HTML Attributes | Polymorphic<as> | - |
<CheckboxElement>
Prop | Type | Default |
---|---|---|
name | string | - |
disabled | boolean | - |
required | boolean | - |
checked | boolean | - |
size | sm | md | lg | - |
HTML Attributes | HTMLAttributes<input> | - |
Examples
size
The size prop cascades: it is inherited from the parent and it is applied to all children.
compact
The compact prop changes the underlying values used by the size
prop. Just like the size
prop it cascades, which means it is inherited from the parent and it is applied to all children.
With the compact prop you are able to use the same component in different contexts, like in a large hero or a small card. It will automatically adapt.