CSC Design System next
VueFlavour Vue React Angular TypeScript PrimaryCSC UI ColorsPrimarySecondaryAccentCustom ColorsRedOrangeGreenBluePurplePink
Guides Getting started Customization Data visualization Migration guide Componentsc-accordionc-alertc-autocompletec-badgec-buttonc-button-groupc-cardc-checkboxc-csc-logoc-data-tablec-dividerc-iconc-icon-buttonc-inputc-linkc-listc-loaderc-login-buttonsc-login-cardc-mainc-menuc-messagec-modalc-navigation-buttonc-otp-inputc-pagec-paginationc-popoverc-progress-barc-progress-circlec-radio-groupc-selectc-side-navigationc-sliderc-spinnerc-statusc-stepsc-switchc-tablec-tabsc-tagsc-text-fieldc-toastsc-toolbarc-tooltip

<c-checkbox>

A form control for a single on/off choice: a native checkbox with a label, an optional hint, and validation messaging.

Usage

Bind the state with a plain v-model (or the checked prop); true-value / false-value map the checked state onto custom values. Set indeterminate for the mixed "some but not all" state of a parent checkbox.

<c-checkbox v-model="accepted" label="I accept the terms" />

Set hint for a persistent helper line below the control; while valid is false, error-message replaces it. hide-details removes the message area entirely.

When to use

  • A single independent yes/no choice (consent, feature toggle in a form).
  • A list where several options can be selected at once.

When not to use

  • Choosing exactly one of several options — use c-radio-group.
  • Switching a setting that takes effect immediately — use c-switch.

Customization

Restyle via CSS parts from your own stylesheet. The indicator part is the checkbox box and mark is the check glyph inside it. The indicator's border, its checked fill and its keyboard focus ring all draw with currentColor, so one color recolours the three together; the host exposes the checked and indeterminate custom states, so the box is also stylable per state:

/* Border, checked fill and focus ring follow `color`. */
c-checkbox::part(indicator) {
  color: var(--my-green);
}

/* The mark draws with currentColor too — recolour it via `color`. */
c-checkbox:state(checked)::part(mark) {
  color: black;
}

/* Finer control still works per property and per state (the focus ring
   keeps following `color`, not these). */
c-checkbox:not(:state(checked))::part(indicator) {
  border-color: gray;
}

For app-wide recolouring prefer the design tokens (--c-primary seed) over per-component rules.

Examples

Basic
Vue React Angular TypeScript
<template>
  <div class="example-row">
    <c-checkbox v-model="subscribed" hint="You can unsubscribe at any time">
      Subscribe to the newsletter
    </c-checkbox>

    <p>Value: {{ subscribed }}</p>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const subscribed = ref(false);
</script>
States
Vue React Angular TypeScript
<template>
  <div class="example-row">
    <c-checkbox hide-details>Unchecked</c-checkbox>

    <c-checkbox checked hide-details>Checked</c-checkbox>

    <c-checkbox indeterminate hide-details>Indeterminate</c-checkbox>

    <c-checkbox disabled hide-details>Disabled</c-checkbox>

    <c-checkbox checked disabled hide-details>Checked and disabled</c-checkbox>
  </div>
</template>

API reference

<c-checkbox>

A form control for a single on/off choice: a native checkbox with a label, an optional hint, and validation messaging.

Properties

PropertyAttributeTypeDefaultDescription
checkedcheckedbooleanfalseIf `true`, the checkbox is selected.
disableddisabledbooleanfalseDisable the checkbox
errorMessageerror-messagestring''Error message shown in place of the hint while the checkbox is invalid
falseValuefalse-valueboolean | number | stringfalseThe value when the checkbox is unchecked
hideDetailshide-detailsbooleanfalseHide the hint and error messages
hinthintstring''Hint text for the input
hostIdhost-idstring''Id of the element
hostNamehost-namestring''Name of the input - Only used when the checkbox participates in a native `<form>`
indeterminateindeterminatebooleanfalseIndeterminate state
labellabelstring''Element label
requiredrequiredbooleanfalseSet as required
trueValuetrue-valueboolean | number | stringtrueThe value when the checkbox is checked
validvalidbooleantrueSet the validity of the input
valuevalueboolean | number | stringfalseThe input value - Only used when the checkbox participates in a native `<form>`

Events

EventDetailDescription
changevoidStandard bubbling DOM change event, re-dispatched from the host when the checkbox is toggled (the inner input's change does not cross the shadow boundary). No detail; read the new value from the host's `value` property.
changeValueboolean | number | stringFired when the checkbox is toggled, carrying the new value — `trueValue` when checked, `falseValue` when unchecked. Also dispatched as `change-value` — bind that name in Vue templates.
inputvoidNative bubbling input event fired on toggle so a plain Vue `v-model` works without the `v-control` directive. No detail.
update:valueboolean | number | stringv-model contract event fired on toggle, carrying the new value — `trueValue` when checked, `falseValue` when unchecked.

Slots

SlotDescription
defaultDefault slot for the label

CSS parts

Style from outside with c-checkbox::part(name) — parts are the library's only styling customization API.

PartDescription
rootThe outer wrapper containing the checkbox, label and message
labelThe `<label>` element wrapping the indicator and the label content
indicatorThe checkbox box itself — the bordered square that fills when checked; border, fill and the keyboard focus ring (its `::before`) all draw with `currentColor`, so `color` recolours them together
markThe SVG check / indeterminate glyph revealed inside the indicator; draws with `currentColor`, so `color` recolours it
contentWrapper around the label text or slotted label content
messageThe hint / error message area below the checkbox (always reserved unless `hide-details`)

Custom states

Select on the host's live state with c-checkbox:state(name) — combine with ::part() for per-state styling, e.g. c-checkbox:state(checked)::part(indicator).

StateDescription
checkedPresent while the checkbox is checked
indeterminatePresent while the checkbox is in the indeterminate state