Skip to content

Checkbox

Allows users to select one or more options from a set.

First release: 1.0.0 Latest update: July 1, 2025 Current version: 1.0.0

React Angular Vue Svelte HTML

Import

import { PlusCheckbox } from '@plusui/react';
import { PlusCheckboxComponent } from '@plusui/angular';
import { PlusCheckbox } from '@plusui/vue';
import PlusCheckbox from '@plusui/svelte';
<script src="https://cdn.jsdelivr.net/npm/@plusui/core"></script>

Package

@plusui/react
@plusui/angular
@plusui/vue
@plusui/svelte
@plusui/core

Docs

Changelog

Checkbox Changelog

Recent changes and updates for the checkbox component

v1.0.0

June 20, 2025
Feat

Added Checkbox component with group support

  • Individual checkbox with label
  • Indeterminate state support
  • Form integration with proper validation
  • Accessibility with ARIA attributes
  • Custom styling with design tokens

The Checkbox component allows users to make a binary choice, such as toggling an option on or off. It’s commonly used in forms and settings.

Checkbox - anatomy

A standard checkbox with a label.

Label
Show code

Use the checked prop to control the selection state. The indeterminate prop represents a state where the checkbox is neither checked nor unchecked, often used in parent checkboxes.

UncheckedCheckedIndeterminate
Show code

The size prop controls the checkbox dimensions.

SizeSizeSize
Show code

Set the disabled attribute or prop to prevent user interaction.

Disabled UncheckedDisabled CheckedDisabled Indeterminate
Show code

Set the error attribute or prop to indicate a validation error.

Error UncheckedError CheckedError Indeterminate
Show code

You can provide the label text either via the default slot or the text prop. The default slot takes precedence.

Label via Slot
Show code

Listen for the plus-change event to react when the checked state changes.

Notify on Change
Show code
Show console

Use the plus-checkbox-group component to group related checkboxes. The group manages the value (an array of checked checkbox values) and can control properties like size and disabled for all nested checkboxes. Use the vertical prop on the group to arrange checkboxes vertically.

HTMLCSSReactAngularVueSvelte (disabled)
Show code
Show console
Checkbox - layout spacing Checkbox - light & dark mode
  • Keyboard Behavior:
    • Checkboxes are focusable via the Tab key.
    • The state can be toggled using the Space key when focused.
  • Screen Reader:
    • Uses a native <input type="checkbox"> internally, ensuring standard screen reader announcements for state (checked, unchecked, mixed, disabled).
    • The label provided via the slot or text prop serves as the accessible name, linked via the <label> element.
    • aria-checked is set to true, false, or mixed based on the checked and indeterminate props.
    • aria-disabled is set based on the disabled prop.
    • aria-invalid is set based on the error prop.
  • Required Developer Actions:
    • Always provide a visible label either through the default slot or the text prop. Avoid using checkboxes without labels.
    • Ensure sufficient color contrast between the checkbox and its background, and the checkmark/text and the checkbox background, especially when customizing colors.
Site favicon Plus UI Design System on Figma
Visit
NameTypeDefaultDescriptionRequired
namestringundefinedThe name attribute for the internal input, used in form submission.No
size'sm' | 'md' | 'lg''md'Size of the checkbox. Inherited from group if nested.No
checkedbooleanfalseWhether the checkbox is checked. Managed by group if nested.No
indeterminatebooleanfalseWhether the checkbox is in an indeterminate state.No
disabledbooleanfalseWhether the checkbox is disabled. Inherited from group if nested.No
valuestring'on'The value submitted with form data when the checkbox is checked.No
errorbooleanfalseDisplays the checkbox in an error state (e.g., invalid input).No
textstringundefinedText label for the checkbox (alternative to default slot). The slot takes precedence.No
NameTypeDefaultDescriptionRequired
valuestring[][]An array of values corresponding to the checked checkboxes.No
verticalbooleanfalseIf true, displays checkboxes vertically instead of horizontally.No
size'sm' | 'md' | 'lg''md'Sets the size for all nested checkboxes.No
disabledbooleanfalseDisables all nested checkboxes.No
NamePayload TypeDescription
plus-changeEventFired when the checked state changes.
plus-focusFocusEventFired when the checkbox gains focus.
plus-blurFocusEventFired when the checkbox loses focus.
NamePayload TypeDescription
plus-changeCustomEvent<{ value: string[] }>Fired when the group’s value changes (any checkbox toggled).
NameDescription
default (unnamed)The label content for the checkbox. Overrides text.
NameDescription
default (unnamed)Container for plus-checkbox elements.
PartDescription
baseThe main container element (<label>).
controlThe container wrapping the visual checkbox and the native input.
checkboxThe visual representation of the checkbox box.
iconThe checkmark or indeterminate icon (<plus-icon>).
labelThe container for the label text (slot content or text prop).
PartDescription
baseThe main container element (div).
NameDescription
--checkbox-sizeControls the size of the checkbox control.
--checkbox-color-defaultDefault background color of the checkbox.
--checkbox-color-checkedBackground color when checked or indeterminate.
--checkbox-color-borderBorder color of the checkbox.
--checkbox-color-border-checkedBorder color when checked or indeterminate.
--checkbox-color-iconColor of the checkmark or indeterminate icon.
--checkbox-border-color-errorBorder color when in the error state.

Join the Community

Plus UI is built by the community. Join us on our platforms to contribute, get help, and stay up to date.