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

<c-radio-group>

A radio group is a set of mutually exclusive choices where exactly one can be selected, authored as slotted `c-radio` children. Give the group a `label` so the choice it represents is named for every user, and a `hint` describing how to answer.

Usage

Authoring the options

Each option is a <c-radio value="..."> whose default slot is its label — keep the label text (or richer markup) inside the radio so it stays clickable and is announced with the control:

<c-radio-group label="Subscription plan" value="free">
  <c-radio value="free">Free</c-radio>
  <c-radio value="paid">Paid</c-radio>
</c-radio-group>

The radios may sit at any depth inside the default slot, so custom layouts are plain markup — wrap each radio in whatever layout element the design needs:

<c-radio-group label="Subscription plan" value="free">
  <div class="card"><c-radio value="free">Free</c-radio></div>
  <div class="card"><c-radio value="paid">Paid</c-radio></div>
</c-radio-group>

Text placed next to a radio instead of inside it renders, but is not click-associated or announced — put the label content in the radio's slot.

Value

The group's value is the selected radio's value, matched by strict string equality; the group holds string values only. Selection is expressed solely through the group — radios carry no checked state of their own. Giving two radios the same value is a consumer error: every matching radio will show as checked.

In Vue, bind with a plain v-model; elsewhere, listen for change, which carries the picked value.

Label

The label prop names the group; when richer label content is needed, use the label slot instead (the prop wins when both are set). The default slot is exclusively the radios' home — loose text there is not treated as a label.

Validation

Validation is your job: set invalid and supply an error-message explaining why. In a native <form> the picked value submits under name, and a form without novalidate stops a submit while a required group has no pick; see In a form on c-button. While invalid without an error-message, the hint keeps rendering as a hint. The message area reserves its height (unless hide-message), so an error appearing at runtime doesn't shift the layout.

Accessibility

The group is announced as a radiogroup named by its label. Keyboard behavior follows the native pattern: Tab moves into the group (onto the checked radio, or the first enabled one) and out of it in one stop; the arrow keys move between radios, selecting as they go, wrapping at the ends and skipping disabled radios; Space selects the focused radio. Enter is left to the surrounding form.

<c-radio>

A single radio option inside a c-radio-group: a native radio input whose default slot is its clickable, announced label.

Author one c-radio per option, with a unique value and the option's label content in the default slot. Selection state belongs to the group — a radio has no checked prop; set the group's value (or v-model) instead.

<c-radio value="paid">Paid</c-radio>

Set disabled to exclude a single option while the rest of the group stays operable.

Events

A radio fires no event of its own: listen on the c-radio-group, whose change carries the picked value.

Standalone

Outside a group a radio still renders and operates — it can be selected but never unselected, like a native radio without siblings — but reports nothing. Grouping behavior (exclusivity, arrow-key navigation, value events) requires the parent c-radio-group.

Accessibility

Each radio is a native input named by its label; an aria-label on the element names it instead where there is no visible one.

Customization

Restyle via CSS parts from your own stylesheet. The indicator part is the radio ring; the selection dot is its ::after pseudo-element and the keyboard focus ring its ::before. Ring, dot and focus ring all draw with currentColor, so color recolours the whole indicator, focus ring included. The host exposes the checked and disabled custom states (both also cover group-driven selection and disabling):

c-radio:state(checked)::part(indicator) {
  color: var(--my-green);
}

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

Examples

Basic
Vue React Angular TypeScript
<template>
  <div>
    <c-radio-group
      v-model="plan"
      hint="You can change the plan later"
      label="Subscription plan"
    >
      <c-radio value="free">Free</c-radio>

      <c-radio value="pro">Pro</c-radio>

      <c-radio value="enterprise">Enterprise</c-radio>
    </c-radio-group>
  </div>
</template>

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

const plan = ref('free');
</script>
Custom layout
Vue React Angular TypeScript
<template>
  <div>
    <c-radio-group
      v-model="plan"
      hint="You can change the plan later"
      label="Subscription plan"
    >
      <div class="plan-option">
        <c-radio value="free">Free</c-radio>
      </div>

      <div class="plan-option">
        <c-radio value="pro">Pro</c-radio>
      </div>

      <div class="plan-option">
        <c-radio value="enterprise">Enterprise</c-radio>
      </div>
    </c-radio-group>
  </div>
</template>

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

const plan = ref<'enterprise' | 'free' | 'pro'>('free');
</script>

<style>
/* The radios are ordinary light DOM: wrap them in your own layout markup and
   style it with your own CSS. Keep the label text inside the <c-radio> so the
   whole row stays click-associated. */
.plan-option {
  border: 1px solid var(--c-border);
  border-radius: 0.5rem;
  padding: 0 0.75rem;
}
</style>
Inline
Vue React Angular TypeScript
<template>
  <div>
    <c-radio-group
      v-model="frequency"
      label="Email frequency"
      hide-message
      inline
    >
      <c-radio value="daily">Daily</c-radio>

      <c-radio value="weekly">Weekly</c-radio>

      <c-radio value="never">Never</c-radio>
    </c-radio-group>
  </div>
</template>

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

const frequency = ref('weekly');
</script>
Basic · c-radio
Vue React Angular TypeScript
<template>
  <div>
    <c-radio-group
      v-model="plan"
      hint="You can change the plan later"
      label="Subscription plan"
    >
      <c-radio value="free">Free</c-radio>

      <c-radio value="pro">Pro</c-radio>

      <c-radio value="enterprise" disabled>Enterprise</c-radio>
    </c-radio-group>
  </div>
</template>

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

const plan = ref('free');
</script>

API reference

<c-radio-group>

A radio group is a set of mutually exclusive choices where exactly one can be selected, authored as slotted `c-radio` children. Give the group a `label` so the choice it represents is named for every user, and a `hint` describing how to answer.

Properties

PropertyAttributeTypeDefaultDescription
disableddisabledbooleanfalse Disable the radio group
errorMessageerror-messagestring'' Error message shown in place of the hint while the group is invalid
hideMessagehide-messageboolean— Hide the message line — the hint and error messages under the field — and the room it keeps.
hinthintstring'' Hint text for the input
inlineinlinebooleanfalse Display radio buttons inline
invalidinvalidbooleanfalse Show the control as invalid: its `error-message`, when set, replaces the hint, and the control is marked `aria-invalid`.
labellabelstring'' Label of the radio group
namenamestring'' The name the picked radio's value submits under in a native `<form>`; nothing submits while no radio is picked
requiredrequiredbooleanfalse Set as required
valuevaluenull | stringnull Value of the radio group; matched against each radio's `value` by strict string equality
hideDetails deprecated hide-detailsbooleanfalse Deprecated. Use `hide-message`. Hide the hint and error messages

Events

EventDetailDescription
changestringFired when the user selects a radio, carrying the selected radio's value.
inputvoidNative bubbling input event fired on selection so a plain Vue `v-model` stays in sync. No detail.
update:valuestringFired alongside `change` with the same detail — the `v-model` contract.

Methods

MethodSignatureDescription
focus(options?: FocusOptions): voidFocus its tab stop: the checked radio, else the first enabled one, as `focus()` does on a native control: the element renders no box of its own to take it.

Slots

SlotDescription
defaultThe radios' home: `<c-radio>` children, wrappable in arbitrary layout elements at any depth
labelGroup label content, used when the `label` prop is not set

CSS parts

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

PartDescription
rootThe radiogroup wrapper element
labelThe group label above the radio buttons
itemsThe container the radios are slotted into
messageThe hint/error message area below the radios (always reserved unless `hide-message`)

<c-radio>

A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label.

Properties

PropertyAttributeTypeDefaultDescription
disableddisabledbooleanfalse Disable the radio button
valuevaluestring'' Radio button value

Slots

SlotDescription
defaultThe radio's label content, rendered inside the shadow `<label>` so it stays click-associated and announced

CSS parts

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

PartDescription
rootThe `<label>` row wrapping the input, indicator and label content
indicatorThe radio ring itself; the selection dot is its `::after` and the keyboard focus ring its `::before` — all three follow `currentColor`, so `color` recolours the whole indicator, focus ring included
contentWrapper around the slotted label content

Custom states

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

StateDescription
checkedPresent while the radio is the selected option (standalone or group-driven)
disabledPresent while the radio is disabled, by its own prop or by its group