ui

Checkbox

A control allowing the user to toggle between checked and not checked. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

Examples

For accessible labelling and validation, prefer using the Field component to wrap checkboxes. See the related example: Checkbox field.

Disabled

Use the disabled prop to prevent interaction while keeping the checkbox visible in the form layout.

With Description

Adds a short description below the label to clarify what the user is agreeing to or enabling.

Card Style

Wraps the checkbox and its label in a bordered card that highlights on selection — a common terms-acceptance or plan-selection pattern.

Form Integration

Field provides accessible labelling and validation primitives for form controls. Use it with Form to submit values.

Payment Card

A selectable card containing payment method details — clicking anywhere on the card checks the checkbox and highlights the selection.

Select All with Indeterminate State

A parent checkbox that controls a group of children. When only some children are checked the parent displays the indeterminate state; checking it toggles all children on or off.

Issue Label Picker

Eight colored labels each rendered as a checkbox with a color dot. The header updates the selected count live as labels are toggled.

Notification Channel Selector

Four notification channels (email, SMS, push, Slack) as checkboxes. The icon box changes accent color when its channel is enabled, giving immediate visual feedback.

Three required consent items and one optional item. The submit button is disabled until all required items are checked, and its label counts how many remain.

Weekly Availability Grid

A checkbox grid with time slots (Morning, Afternoon, Evening) as rows and days of the week as columns, with a live count of selected slots.

Role Permissions

Four permission levels (Read, Write, Delete, Admin) each rendered as a bordered card row with a colored badge and a description line.

Notification Preferences Matrix

A table with event rows and channel columns (Email, Push, SMS) where each cell is an individually togglable checkbox, with a Save button below.

Plan Add-on Selector

Selectable feature add-ons where the estimated monthly price updates in real time as the user checks or unchecks items.

Sprint Task Checklist

A task list with priority badges (High, Medium, Low). Completed tasks receive a strikethrough, and a celebration banner appears when all tasks are checked off.