Skip to content

Checkbox

Basic Usage

Intent Variants

Sizes

Compact size for dense interfaces

Default size for most applications

Larger size for touch interfaces or prominence

States

Default state when not selected

Active/selected state

Partially selected state, often used in tree structures

Must be checked to proceed

Cannot be interacted with

Locked in checked state

Form Integration

Account Preferences
Customize your account settings

Receive updates via email

Receive updates via SMS

Get our weekly newsletter

Allow sharing of anonymized data for research

Account Deletion
This action cannot be undone

Confirm you understand the consequences

Ensure you have saved any important information

Properties

PropertyTypeDefaultDescription
checkedbooleanfalseWhether the checkbox is checked
indeterminatebooleanfalseWhether the checkbox is in an indeterminate state
disabledbooleanfalseWhether the checkbox is disabled
requiredbooleanfalseWhether the checkbox is required (shows asterisk)
size'small' | 'medium' | 'large''medium'Size variant of the checkbox
intent'default' | 'primary' | 'success' | 'warning' | 'danger''default'Visual intent/state of the checkbox
labelstring-Label text for the checkbox
descriptionstring-Description text below the label
namestring-Name attribute for form submission
valuestring-Value attribute for form submission
idstringauto-generatedUnique identifier for the checkbox
classstring-Additional CSS classes to apply

Accessibility

The Checkbox component follows WCAG 2.1 AA guidelines:

Screen Reader Support

  • Semantic HTML: Uses native <input type="checkbox"> for proper identification
  • Label Association: Proper for attribute linking labels to inputs
  • Description Support: Uses aria-describedby for additional context
  • State Announcement: Screen readers announce checked/unchecked states
  • Required Indication: Both visual and semantic indication of required fields

Keyboard Navigation

  • Space Key: Toggles the checkbox state
  • Tab Navigation: Focuses the checkbox in tab order
  • Focus Indicators: Clear visual focus rings for keyboard users

Visual Accessibility

  • High Contrast: Meets WCAG contrast requirements in all color variants
  • Touch Targets: Minimum 44x44px touch target size (large variant)
  • Color Independence: State is indicated by shape/icon, not just color
  • Motion Sensitivity: Smooth but not excessive transitions

State Communication

  • Indeterminate State: Properly communicated to assistive technology
  • Disabled State: Prevents interaction and announces disability
  • Error States: Uses aria-invalid for validation feedback

Examples

Terms and Conditions

By checking this box, you acknowledge that you have read and agree to our terms of service.

Newsletter Subscription with Options

Newsletter Preferences
Choose how you'd like to hear from us

Get our curated content every Monday

A summary of the month's highlights

Immediate notifications for urgent updates

Multi-level Selection

Choose individual features below

Detailed reporting and insights

Share projects with team members

Use your own logos and colors

Error Validation

This action cannot be undone

Your email address has been confirmed

<!-- Basic Usage -->
<Checkbox label="Subscribe to newsletter" />
<!-- With Description -->
<Checkbox
label="Enable notifications"
description="Get alerts when new content is available"
/>
<!-- Different States -->
<Checkbox checked label="Already selected" />
<Checkbox indeterminate label="Partially selected" />
<Checkbox disabled label="Cannot be changed" />
<!-- Intent Variants -->
<Checkbox intent="success" checked label="Completed task" />
<Checkbox intent="danger" required label="Confirm deletion" />
<!-- Form Integration -->
<Checkbox
name="preferences"
value="email_notifications"
label="Email notifications"
required
/>
<!-- Sizes -->
<Checkbox size="small" label="Compact checkbox" />
<Checkbox size="large" label="Large touch target" />