Use our Tailwind CSS Checkbox
component to allow the user to select one or more items from a set.
You can use a checkbox for:
See below our Checkbox
component examples that you can use in your Tailwind CSS and React project. The examples comes in different styles and colors, so you can adapt it easily to your needs.
Here's how to implement a Checkbox
component. It can be used for forms or other components.
We provide different checkbox colors like primary
, secondary
, info
, success
, warning
, and error
so you can adapt it easily to your needs. You can simply use the color
prop to change the checkbox color.
In the example below, we've showcased the different checkbox colors that you can use in your project.
The Checkbox
component can be used with a label to provide more context to the user. In the example below, we've added a label to the checkbox by using the Checkbox
and Typography
components together.
You can customize and change the icon used for the checkbox by using new icons inside the Checkbox.Indicator
component. In the example below, we use the Star
and StarSolid
icons for checked
and unchecked
states.
To make it work, you need to use group-data-[checked=true]
for the icons to show/hide based on the checkbox state.
You can disable the checkbox by adding the disabled
prop. This will prevent the user from interacting with the checkbox.
Use the example below to create a Checkbox
component with a link to the terms and conditions inside it's label.
Use the example below to create a Checkbox
component with a title and description as it's label to provide more information about the checkbox action.
You can use className
prop to customize the Checkbox
component style. In the example below, we make the checkbox circular.