React
Usage
If you prefer a closed component composition, check out the snippet below.
Examples
Variants
Customize the appearance with different visual styles to match your design:
React
Colors
Use the colorPalette prop to change the color of the checkbox:
React
Sizes
Adjust the size to match surrounding text or interface elements:
React
States
Pass the disabled or invalid prop to the Checkbox.Root component to change the visual state of the checkbox.
React
Controlled
Use the checked and onCheckedChange props to control the checkbox state.
Label
Here's an example of how to change the label position to the left:
React
Indeterminate
Set the checked prop to indeterminate to show the checkbox in an indeterminate state.
React
Description
Here's an example of how to add some further description to the checkbox:
React
Link
Render an anchor tag within the Checkbox.Label to add a link to the label.
React
Closed Component
Here's how to setup the avatar for a closed component composition.
To use the closed component, simply import and use it like this: