Checkbox

Checkbox for binary on/off selection with solid, pill, and ghost variants, an indeterminate state, and rich labels with inline descriptions.

import { Checkbox } from "@plexui/vue/components/Checkbox";

On Phone, a single checkbox stays next to its label, while a list of options goes in the rows of a FieldGroup: each Field row names an option and ends with the checkbox, as in an iOS settings list.

Examples

Overview

variant

With Radio Group

direction
description
Choose how you'd like to be notified.
Select the topics you want to follow.

Descriptions

Choose what the archive includes.

Variants

solid
ghost

Pill

Ghost

With description

Help improve the product with anonymous usage reports.
You can enable or disable notifications at any time from settings.

Indeterminate

Label orientation

orientation

Without label

Group with select all

Group with description

Download over cellular

Choose what can use mobile data.

With Field

Terms

Please review and accept the terms before continuing.

Grouped sections

Notifications

Email notifications

Configure which emails you receive.

Receive emails about new products and features.
Receive emails about account activity and security.

Push notifications

Configure which push notifications you receive.

API

PropTypeDefaultDescription
variant"solid" | "ghost""solid"Visual style: solid (filled background) or ghost (checkmark only)
pillbooleanfalseFully rounded indicator corners
checked / v-model:checkedboolean | "indeterminate"—Controlled state
default-checkedboolean | "indeterminate"—Initial state (uncontrolled)
labelstring—Accessible label rendered next to the checkbox
label slotVNode[]—Rich label content; takes precedence over the label prop
descriptionstring—Second line below the label, linked via aria-describedby (or the description slot)
disabledbooleanfalsePrevent interaction
requiredboolean—Required for form submission
namestring—Form field name
valuestring"on"Value when submitted
orientation"left" | "right""left"Checkbox position relative to the label
classstring—CSS classes applied to the wrapper node
idstring—The id of the checkbox element (generated when omitted)
@update:checked(next: boolean | "indeterminate") => void—Emitted with the next state when it changes (a click always emits a boolean)
@focus(event: FocusEvent) => void—Emitted when the checkbox gains focus
@blur(event: FocusEvent) => void—Emitted when the checkbox loses focus

Other attributes and listeners land on the checkbox <button>. Built on Reka UI Checkbox. Inside a <form>, a hidden native checkbox mirrors the state so the value is submitted and a form reset restores the initial state.

Styling

Checkbox reads these component tokens. Override them at any scope to restyle it:

  • --checkbox-indicator-size: indicator size (default var(--radio-group-indicator-size))
  • --checkbox-ghost-check-color: checkmark color for the ghost variant (default var(--gray-900))
  • --checkbox-checkmark-color: checkmark color on a solid box (default var(--gray-0))
  • --checkbox-check-icon-size: size of the Check and Minus icons on a solid box (default the indicator size)
  • --checkbox-ghost-icon-size: size of the Check and Minus icons for the ghost variant (default the indicator size; 26px in the touch stylesheet)
  • --checkbox-label-gap: label gap (default var(--radio-group-item-gap))
  • --checkbox-label-line-height: label line height (default var(--radio-group-item-line-height))
  • --input-border-color-invalid: border color invalid (default var(--color-border-danger-outline))