Saturation UIsaturation UI
DocsComponentsBlocks
⌘K

Getting Started

IntroductionInstallationTheming

Components

AccordionAI Chat InputAlertAnimated GroupAnimated NumberAvatarBadgeBorder TrailBreadcrumbButtonButton GroupCalendarCardChartCheckboxCollapsibleComboboxCommandContext MenuData TableDate PickerDialogDropdown MenuEmptyFieldGlow EffectInputInput GroupItemKbdMenubarNovel EditorPaginationProgressive BlurProgressSelectSheetSkeletonSonnerSpinnerSpotlightSwitchTableTabsText EffectText ShimmerTextareaToggleToggle GroupTreeTypography
Components
/
Checkbox

Checkbox

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

Installation

npx shadcn@latest add https://ui.saturation.io/r/checkbox.json

Usage

1600 dark:text-blue-400">class="text-purple-600 dark:text-purple-400">import { Checkbox } 600 dark:text-blue-400">class="text-purple-600 dark:text-purple-400">from 600 dark:text-blue-400">class="text-purple-600 dark:text-purple-400">class="text-orange-600 dark:text-orange-400">"@/components/ui/checkbox"
2 
3600 dark:text-blue-400">class="text-purple-600 dark:text-purple-400">export 600 dark:text-blue-400">class="text-purple-600 dark:text-purple-400">default 600 dark:text-blue-400">class="text-purple-600 dark:text-purple-400">function Example() {
4 600 dark:text-blue-400">class="text-purple-600 dark:text-purple-400">return 600 dark:text-blue-400">class="text-cyan-600 dark:text-cyan-400"> />
5}

Examples

With Text

A checkbox with accompanying text and description.

You agree to our Terms of Service and Privacy Policy.

Disabled

A disabled checkbox that cannot be interacted with.

With Label

Using the Label component for better accessibility.

Circle

A circular checkbox variant with three distinct states: empty (styled like a deactivated field with border), filled (entire circle filled with theme color and centered white checkmark), and deactive (styled like a deactivated button).

Select All

A checkbox list with a select all option that shows indeterminate state when some items are selected.

API Reference

Checkbox

Built on top of Radix UI Checkbox. Accepts all Radix Checkbox props.

PropTypeDefaultDescription
checkedboolean-The controlled checked state of the checkbox
defaultCheckedboolean-The default checked state when uncontrolled
onCheckedChangefunction-Event handler called when the checked state changes
disabledbooleanfalseWhen true, prevents the user from interacting with the checkbox
requiredbooleanfalseWhen true, indicates that the user must check the checkbox
namestring-The name of the checkbox for form submission
valuestringonThe value given as data when submitted with a name
shape"default" | "circle""default"The shape of the checkbox (square with rounded corners or circular)

On This Page

  • Installation
  • Usage
  • Examples
  • With Text
  • Disabled
  • With Label
  • Circle
  • Select All
  • API Reference