layout | title | description | group | toc | requires_js | previous | previousLink | next | nextLink |
---|---|---|---|---|---|---|---|---|---|
home |
Tailwind CSS Checkbox - Flowbite |
Get started with the checkbox component to allow the user to select one or more options in the form of a square box available in multiple sizes and colors |
forms |
true |
true |
Textarea |
forms/textarea/ |
Radio |
forms/radio/ |
The checkbox component can be used to receive one or more selected options from the user in the form of a square box available in multiple styles, sizes, colors, and variants coded with the utility classes from Tailwind CSS and with support for dark mode.
Make sure that you have included Flowbite as a plugin inside your Tailwind CSS project to apply all the necessary styles for the checkbox component.
Use this default example of a checkbox element in a checked and unchecked state.
{{< example id="default-checkbox-example" github="forms/checkbox.md" show_dark=true >}}
This example can be used for the disabled state of the checkbox component by applying the disabled
attribute to the input element.
{{< example id="disabled-checkbox-example" github="forms/checkbox.md" show_dark=true >}}
Use this example if you want to add an anchor link inside the label of the checkbox component.
{{< example id="checkbox-link-example" github="forms/checkbox.md" show_dark=true >}}
Get started with this example if you want to add a secondary helper text for the checkbox component.
{{< example id="checkbox-helper-example" github="forms/checkbox.md" show_dark=true >}}
For orders shipped from $25 in books or $29 in other categories
Use this example of a checkbox inside a card element to enable a larger area of clicking activation.
{{< example id="checkbox-bordered-example" class="grid gap-6 md:grid-cols-2" github="forms/checkbox.md" show_dark=true >}}
Use this example to show a list of checkbox items grouped inside a card.
{{< example id="checkbox-list-example" github="components/radio.md" show_dark=true >}}
-
Vue JS
-
React
-
Angular
-
Laravel
Use this example to show a list of checkbox items inside a card horizontally.
{{< example id="checkbox-horizontal-list-example" github="components/radio.md" show_dark=true >}}
-
Vue JS
-
React
-
Angular
-
Laravel
Use this example to show a list of checkbox items inside a dropdown menu.
{{< example id="checkbox-dropdown-example" class="flex justify-center" github="components/dropdowns.md" show_dark=true iframeHeight="430" >}} Dropdown search
-
Bonnie Green
-
Jese Leos
-
Michael Gough
-
Robert Wall
-
Joseph Mcfall
-
Leslie Livingston
-
Roberta Casas
You can align the checkbox elements horizontally by using a wrapper tag and applying the flex
class.
{{< example id="checkbox-inline-example" github="forms/checkbox.md" show_dark=true >}}
Use the text-{color}-{shade}
classes from Tailwind CSS to change the color of the checkbox component.
{{< example id="checkbox-colors-example" class="flex flex-wrap" github="forms/checkbox.md" show_dark=true >}}
Use this example of an advanced layout of checkbox elements where the label parent element can be styled when the checkbox is checked.
{{< example id="checkbox-advanced-example" class="flex flex-wrap" github="forms/checkbox.md" show_dark=true >}}
-
React JsA JavaScript library for building user interfaces.
-
Vue JsVue.js is an model–view front end JavaScript framework.
-
AngularA TypeScript-based web application framework.