Command Palette

Search for a command to run...

Checkbox

A control that allows the user to toggle between checked and not checked.

Installation

pnpm dlx shadcn@latest add https://dga-registry.vercel.app/r/checkbox.json

Basic States

Default, checked, and disabled states of the checkbox.

With Labels

Checkboxes with different label configurations.

This checkbox has a descriptive text that explains what accepting this option means for the user.

You agree to our Terms of Service and Privacy Policy.

Controlled Checkbox

Checkbox with controlled state.

Status: Terms not accepted

Checkbox Groups

Multiple checkboxes for selecting multiple options.

Select Station Types

Notification Preferences

Receive email alerts for air quality updates

Get text messages for critical alerts

Receive push notifications on your device

Active Notifications:

  • • None selected

Pollutant Selection

Select multiple pollutants for monitoring (controlled group).

Selected Pollutants (0):

None selected

Form Examples

Real-world form scenarios using checkboxes.

User Preferences

Data Display Options
Alert Settings

Station Registration

Available Equipment

PM2.5 and PM10 measurement capability

NO₂, SO₂, O₃, CO measurement capability

Temperature, humidity, wind speed, pressure

Data Sharing Permissions

By checking this box, you confirm that the station details and equipment specifications are correct and up to date.

Checkbox in Lists

Checkboxes used for item selection in lists.

Riyadh • Background Station

Riyadh • Suburban Station

Riyadh • Traffic Station

Jeddah • Background Station

Props

PropTypeDefaultDescription
checkedbooleanControlled checked state
defaultCheckedbooleanfalseDefault checked state
onCheckedChange(checked: boolean) => voidCalled when checked state changes
disabledbooleanfalseDisables the checkbox
aria-invalidstringMarks checkbox as invalid
classNamestringAdditional CSS classes