Skip to content

Choice cards specification: GhostRadioCard and GhostCheckboxCard ​

Important

Status: Approved on 2026-12-01 by zprue743, after every change from the first review was applied, recorded in PR #704. This is design approval only, not merge approval of any implementation or release inclusion. The build ships both cards as experimental; see the radio group and checkbox group pages.

Purpose and user problems ​

"Pick one of these cards" is a common form pattern: a room, a plan, a shipping speed, a workspace template. Each option is a bordered surface with a title, a line or two of detail, and a visible selected state. The whole surface is the click target.

GhostVue has no part for it today. An app that built a room chooser on 0.2.0 did this:

vue
<GhostRadioGroup v-model="room" name="room">
  <GhostCard v-for="room in rooms" :key="room.id">
    <GhostRadioGroupItem :id="`room-${room.id}`" :value="room.id" />
    <label :for="`room-${room.id}`">{{ room.name }}</label>
    <p>{{ room.detail }}</p>
  </GhostCard>
</GhostRadioGroup>

Three things go wrong:

  • Only the radio and its <label> text respond to a click. Clicking the card's padding, its detail line, or its price does nothing.
  • The card has no selected state of its own. The app writes CSS against the radio's data-state with :has(), and each app writes it differently.
  • Forced colors drop the app's selected background, so the only remaining cue is the small radio dot.

GhostRadioCard and GhostCheckboxCard are card-shaped members of the existing groups. Each renders a native <label> around the group's native input, so the whole card activates the input with no script. Each mirrors the input's state onto the card. The groups keep their model, form, reset and keyboard behavior unchanged, because the input inside the card is the same GhostRadioGroupItem or group-member GhostCheckbox the groups already manage.

Non-goals ​

  • No change to group behavior. GhostRadioGroup and GhostCheckboxGroup keep their props, models, keyboard, form submission and reset. A card is another member, nothing more.
  • No variant="card" on the existing items. GhostRadioGroupItem and group-member GhostCheckbox render a void <input> and expose it as element. A card needs a wrapping element and slots, which would change both contracts (see Design decision).
  • No standalone checkbox card. GhostCheckboxCard must sit inside GhostCheckboxGroup. A single boolean card ("I agree to the terms") is a plain GhostCheckbox in a label.
  • No interactive content inside a card in v1. HTML forbids other labelable controls (buttons, inputs, selects) inside a <label>. Links are valid there, but a link inside a card follows the link instead of choosing the card, and adds a second tab stop to a radio card. v1 does not support links either. "View photos" or "Compare plans" actions go outside the card.
  • No hidden indicator in v1. The radio dot or check mark always shows. It is the selected cue that does not depend on color.
  • No as prop. The root must be a <label> for native activation.
  • No indeterminate card. A mixed "select all" stays a plain GhostCheckbox, as the checkbox group spec describes.
  • No roving focus, arrow keys for checkboxes, or grid navigation across cards. Keyboard behavior comes from the native inputs.
  • No layout component. Arranging cards in a grid or row is consumer or themed CSS on the group root.
  • No visual styling in @ghostvue/vue. Borders, padding and the selected appearance live in @ghostvue/themes.

Design decision ​

Three shapes were compared against the same five checks.

ShapeWhole-card click targetSelected, focus and disabled in forced colorsDisabled stateGroup keyboard unchangedPublic API cost
A. New GhostRadioCard and GhostCheckboxCard parts (chosen)Yes. The root is a native <label> around the input.Yes. The card root carries data-state and data-disabled, so the theme draws a border-width change and system colors on the card itself, plus the indicator's existing forced-colors marks.Native disabled on the input, plus data-disabled on the card root for the card's own style.Yes. The input is the existing group member.Two new parts, each with value, disabled, two slots and four exposed members. One listener fallthrough fix on GhostRadioGroupItem; no other change to existing parts.
B. variant="card" on GhostRadioGroupItem and on group-member GhostCheckboxOnly if the variant changes the root from <input> to <label>.Yes, once the root changes.The same as A, once the root changes.Yes.The variant changes what element returns, where fallthrough attributes land, and whether the void part has slots. A prop that swaps the root element is two components behind one name.
C. Documented recipe: GhostCard with as, a wrapping <label>, and the item insidePartly. GhostCard allows only div, article, section, aside, a and button roots, so the recipe wraps the card in a <label>. Its header and content divs are then invalid inside a <label>.Only with app CSS such as :has(:checked). That CSS is what the feedback asked to remove.Native disabled on the input; the card's disabled look is app CSS such as :has(:disabled).Yes.None, but every app repeats the markup and the selected styles.

Shape A is the only one that gives the card a selected state of its own without changing an existing contract. It reuses the item and member logic instead of copying it.

Public API ​

Package boundary and exports ​

@ghostvue/vue:

  • GhostRadioCard: card member of GhostRadioGroup. Renders a <label> root and a GhostRadioGroupItem inside it.
  • GhostCheckboxCard: card member of GhostCheckboxGroup. Renders a <label> root and a group-member GhostCheckbox inside it.
  • Types: GhostRadioCardProps, GhostRadioCardExposed, GhostCheckboxCardProps, GhostCheckboxCardExposed.
  • No new composable. The cards read the existing internal group contexts to mirror data-state and data-disabled onto the root. No context key, provider or helper is exported.

@ghostvue/themes:

  • GhostRadioCard, GhostCheckboxCard: thin wrappers in the same pattern as the themed GhostRadioGroupItem. They add no props in v1. Styles live in new ghost-radio-card.css and ghost-checkbox-card.css recipes that read existing semantic tokens (see Rendering and customization).

No code is added to @ghostvue/core.

Props and configuration ​

GhostRadioCard ​

PropTypeDefaultContract
valuestring(required)Passed to the inner GhostRadioGroupItem. Same rules as the item's value: stable, unique in the group, and the submitted value.
disabledbooleanfalsePassed to the inner item. The card is disabled when this or the group's disabled is true.

GhostCheckboxCard ​

PropTypeDefaultContract
valuestring(required)Passed to the inner GhostCheckbox as its member value. Same rules as a checkbox group member: an opaque string, typed by the group.
disabledbooleanfalsePassed to the inner checkbox. The card is disabled when this or the group's disabled is true.

Both cards throw during setup when no matching group is above them, with the same wording as GhostRadioGroupItem: GhostRadioCard must be used inside GhostRadioGroup and GhostCheckboxCard must be used inside GhostCheckboxGroup.

Attribute fallthrough ​

Both cards set inheritAttrs: false and split attributes so a card can replace an item without moving its wiring:

  • class, style and data-visual-state go to the <label> root.
  • Everything else goes to the inner input, through the inner item's own fallthrough rules: id, name (checkbox only, with the existing GHOST017 warning when it differs from the group's), aria-*, other data-*, and listeners such as @change, @focus and @blur.
  • GhostRadioGroupItem currently drops a consumer onChange instead of chaining it, although the radio group spec says listeners attach to the input. The build fixes the item to call a consumer onChange after its own handler, so @change works on both the item and the radio card. This is a bug fix, not a contract change.
  • GhostCheckboxCard does not forward indeterminate; it is dropped, so the input and the card root cannot disagree. modelValue, defaultValue and onUpdate:modelValue are forwarded only so the existing GHOST016 warning fires; as on any group member, they have no effect.
  • A consumer aria-labelledby replaces the card's generated one. A consumer aria-describedby is joined after the generated description id, separated by a space.
  • A consumer aria-label is not supported, because the generated aria-labelledby takes precedence over it. Name a card with the default slot or with aria-labelledby.
  • form on a checkbox card is dropped with the existing GHOST015 warning, as for any group member.

v-model contracts ​

None on the cards. The owning group's v-model is the only model:

  • GhostRadioGroup: string | undefined, controlled or uncontrolled, with defaultValue and form reset as its spec defines.
  • GhostCheckboxGroup: readonly TValue[], controlled or uncontrolled, with defaultValue and form reset as its spec defines.

A card never emits a model update itself. Its inner input does, through the group, exactly as a plain item or member would. When the parent ignores a controlled update, the group's existing restore step puts the input back, and the card's data-state follows the group's state, not the DOM checked property.

Events, slots, and exposed methods ​

No component-specific events. Native change, input, focus and blur on the inner input reach listeners passed to the card (see Attribute fallthrough). A click listener passed to the card also lands on the input, which receives the synthetic click the label dispatches, so it fires once per activation.

SlotPartRequiredContract
defaultlabelYesThe option's accessible name. Rendered in a <span data-part="label"> whose id the input references with aria-labelledby. Phrasing content only.
descriptiondescriptionNoSupporting detail. Rendered in a <span data-part="description"> only when the slot is provided, and its id is added to the input's aria-describedby. Phrasing only.

Slot content must be phrasing content (text, strong, em, img, GhostBadge and other span roots) and must not contain interactive elements, because both slots sit inside a <label>. Use CSS (display: block or grid) for layout inside a card rather than block elements. The build does not check this at runtime; the docs and examples state it, the same way the card spec handles nested interactives in action roots.

Exposed template ref, the same shape on both cards:

MemberTypeContract
elementHTMLLabelElement | nullThe card root after mount. Matches the repository convention that element is the root.
inputElementHTMLInputElement | nullThe inner radio or checkbox input after mount.
focus(options?) => voidFocuses the inner input. A disabled input does not take focus, as with the items.
blur() => voidBlurs the inner input.

State model ​

A card has no state of its own. It mirrors its input's group state on the root:

ConditionRoot data-stateRoot data-disabledInput
Selected (radio) or checked (checkbox)checkedomittedchecked, data-state="checked" (existing item hooks)
Not selectedomittedomittednot checked
Card disabled or group disabledas above""native disabled
Selected and disabledchecked""checked and disabled

The root data-state is computed from the same group state the input's data-state uses (isSelected for both groups), so the two never disagree after a render. The root uses data-disabled rather than a second data-state value so a selected disabled card keeps both hooks.

data-disabled reflects only the card's and the group's disabled props. An input can also be disabled by an ancestor <fieldset disabled> (for example a consumer fieldset or GhostFieldset) without either prop. The themed disabled style therefore matches [data-disabled] or :has(> input:disabled), so such a card looks and behaves disabled, as plain items already do through :disabled.

Loading, empty, disabled, read-only, and error states ​

  • Disabled. Clicking a disabled card does nothing, because a <label> does not activate a disabled input. A disabled card is not a tab stop. A selected disabled card does not submit its value, because native forms omit disabled controls. The cards do not change that.
  • Invalid. The group's invalid prop keeps marking only the group root (aria-invalid="true", data-state="invalid"). The themed recipe draws unselected cards inside an invalid group with the danger border so the error is visible on the cards, not only on the group. Cards themselves get no aria-invalid.
  • Read-only, loading, empty. Not supported by either group, and the cards add none. An empty group with no cards renders nothing extra.

Async behavior ​

None. Activation and state are synchronous through the native input and the group.

Accessibility contract ​

Semantics and relationships ​

  • Root: native <label>. It has no role and is not focusable.
  • Control: the inner native <input type="radio"> or <input type="checkbox">, unchanged from the existing items. Radio cards share the group's name (explicit or generated), so they form one native radio group.
  • Name: aria-labelledby on the input points at the label part, so the name is only the default slot's text. Without it, the wrapping <label> would make the name the whole card's text, description included.
  • Description: when the description slot is used, its id joins the input's aria-describedby.
  • Group: unchanged. A fieldset root with a legend (or aria-labelledby) names the group of cards, and GhostField wiring works as it does for items.

Keyboard interaction ​

Unchanged from the groups, because the focus target is the same native input.

KeyGhostRadioCard in GhostRadioGroupGhostCheckboxCard in GhostCheckboxGroup
Tab / Shift+TabOne tab stop for the group: the selected card's input, else the engine's native entry point.One tab stop per enabled card.
ArrowDown / ArrowRightMoves to the next enabled card and selects it (RTL mirroring per engine, as documented).No effect.
ArrowUp / ArrowLeftMoves to the previous enabled card and selects it.No effect.
SpaceSelects the focused card when it is not selected.Toggles the focused card.
EnterSubmits the owning form when it has one (native).Submits the owning form when it has one (native).

The per-engine differences recorded in the radio group spec (RTL arrows in WebKit, backward Tab into an unselected group) apply to cards unchanged.

Focus behavior ​

  • Focus stays on the native input. The card does not move or trap focus.
  • Clicking a card focuses its input in engines that focus inputs on label click. The theme draws focus on the card root when the input matches :focus-visible, so pointer clicks do not show a focus ring where the engine does not report :focus-visible.
  • Inside a card, the theme draws the focus ring on the card instead of the indicator, so one ring shows.
  • Disabled cards are skipped by Tab and by radio arrow keys, as their inputs are.

Assistive technology expectations ​

A screen reader reaching a radio card announces the input role, the default slot text as its name, its checked state, its position in the group (2 of 4 where supported), and the description. For example: "Ocean suite, radio button, checked, 2 of 4, King bed, sleeps 2, 240 dollars a night". A checkbox card announces "Late checkout, checkbox, not checked, Leave at 2 PM, 30 dollars". The card's border and background add nothing to the announcement.

Manual assistive-technology checks (NVDA with Firefox, VoiceOver with Safari) are planned for the build issue, as for other experimental components. No manual results are recorded in this spec.

Rendering and customization ​

Markup ​

Rendered shape, for reference. Wrapper nesting beyond these hooks is not API.

html
<label class="ghost-radio-card" data-part="root" data-state="checked">
  <input
    type="radio"
    class="ghost-radio-group-item"
    name="room"
    value="ocean"
    aria-labelledby="ghost-radio-card-label-…"
    aria-describedby="ghost-radio-card-description-…"
    …
  />
  <span data-part="label" id="ghost-radio-card-label-…">Ocean suite</span>
  <span data-part="description" id="ghost-radio-card-description-…">
    King bed · Sleeps 2 · $240 a night
  </span>
</label>

GhostCheckboxCard is the same with class ghost-checkbox-card and an inner input.ghost-checkbox.

Stable hooks ​

  • Root classes ghost-radio-card and ghost-checkbox-card.
  • Root data-part="root", data-state="checked" (or omitted) and data-disabled (or omitted).
  • Parts data-part="label" and data-part="description" on the two spans.
  • The inner input keeps its existing class and hooks (ghost-radio-group-item or ghost-checkbox, its data-part and data-state).
  • data-visual-state on the root (hover, focus-visible, active) for the docs and visual-test state galleries, as on other themed parts.

Themed appearance ​

The themed recipes reuse the GhostCard surface tokens and the existing indicator styles. No new public tokens.

  • Layout. A grid with the indicator in the first column (inline-start, aligned to the first line of the label) and the label and description stacked in the second. Card padding uses --ghost-space-inset-md; the description uses the muted foreground and a smaller type step. The card fills its grid or flex track; arranging cards is the group root's layout (vertical stack by default, orientation="horizontal" wraps them in a row).
  • Size. The cards add no size prop in v1. Inside a themed group with size="sm" or size="lg", only the indicator follows the group size, through the existing --_ghost-radio-hit wiring for radio cards and the indicator box for checkbox cards. Card padding and type stay the same at every size.
  • Resting. Card background --ghost-elevation-1-bg, hairline border --ghost-elevation-1-border, radius --ghost-radius-md, cursor: pointer.
  • Hover. Background mixed with --ghost-state-layer-hover, as the checkbox hover fill is.
  • Selected. Border color --ghost-border-primary and border width doubled from the hairline, with padding reduced by the same amount so the content does not shift. Background mixed with --ghost-state-layer-selected. The indicator shows its existing dot or check mark.
  • Focus visible. The card root draws the standard focus ring (--ghost-focus-ring-* outline and offset) when its input is :focus-visible. The indicator's own ring is suppressed only by the same :has(> input:focus-visible) rule that draws the card ring, so in an engine without :has() the indicator ring remains and focus stays visible.
  • Disabled. cursor: not-allowed and --ghost-action-disabled-opacity on the whole card, matching the radio item. Matches [data-disabled] or :has(> input:disabled) (see State model).
  • Invalid group. Unselected cards inside an invalid group use --ghost-border-danger.
  • Dark mode. No separate rules: every value above is a semantic token that already has a dark value.
  • Forced colors. The card keeps forced color adjustment, so system colors replace the backgrounds. The selected state survives as three non-background cues: the doubled border width, a Highlight border color, and the indicator's existing Highlight dot or check. Focus is a Highlight outline on the card. Disabled cards use a GrayText border and text, at full opacity.
  • Reduced motion. Border and background transitions use the instant duration, as the checkbox does.

The themed recipes use :has(), as the button and collapsible recipes already do, for the card focus ring (.ghost-radio-card:has(> input:focus-visible)) and as the second match for the disabled style. Selected styles read the root's own data-state.

Environment behavior ​

SSR and hydration ​

  • Ids for the label and description spans come from useGhostId, which is SSR-stable, so aria-labelledby and aria-describedby match between server and client.
  • The root data-state is rendered on the server from the group's initial model (modelValue or defaultValue), so the selected card is styled before hydration. The input's checked attribute is rendered the same way the items render it today.
  • The description span renders only when the slot exists on both server and client. No browser API is read during setup.

Mobile and touch ​

  • The whole card is the touch target, so it is far larger than the --ghost-control-size-* minimum.
  • A tap on the label, the description or the padding activates the input natively. There is no gesture and no hover-only information.
  • A tap does not open the virtual keyboard: the input is a radio or checkbox.

Performance ​

A card adds one root element, one or two spans, two ids and one computed state read from the group's existing reactive state. Typical use is two to a dozen cards. No virtualization is planned; a long list of choices belongs in a GhostSelect or GhostCombobox. The cards do not copy or watch the group's model beyond the existing isSelected read.

Composition ​

  • GhostRadioCard renders GhostRadioGroupItem. It reuses item registration, disabled handling, controlled restore, form reset and the generated group name.
  • GhostCheckboxCard renders a group-member GhostCheckbox. It reuses member registration, the array model, the GHOST015, GHOST016 and GHOST017 development warnings, and member form reset.
  • Both inject the existing internal group context keys only to compute the root's data-state and data-disabled.
  • useGhostId for the label and description ids.
  • They do not use GhostCard. A card's root must be a <label>, which GhostCard does not offer, and GhostCard's div parts are not valid label content. The themed recipes reuse the card's surface tokens instead.
  • They do not use useRovingFocus, useFocusScope or useGhostInteractiveSurface.

Spec amendments in this change ​

  • Radio group spec: the non-goal "Card-style or button-role toggles" now points card-style choices to GhostRadioCard and keeps button-role toggles with GhostToggleGroup.
  • Checkbox group spec: a note that GhostCheckboxCard is a supported member alongside GhostCheckbox.
  • Card spec: the non-goal "Card selection" points to the choice cards.

Room chooser traces ​

Single choice with GhostRadioGroup ​

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

import { GhostRadioCard, GhostRadioGroup } from '@ghostvue/themes'

interface Room {
  id: 'garden' | 'ocean' | 'loft' | 'family'
  name: string
  detail: string
  soldOut?: boolean
}

const rooms: readonly Room[] = [
  {
    id: 'garden',
    name: 'Garden room',
    detail: 'Queen bed · Sleeps 2 · $160 a night',
  },
  {
    id: 'ocean',
    name: 'Ocean suite',
    detail: 'King bed · Sleeps 2 · $240 a night',
  },
  {
    id: 'loft',
    name: 'Loft',
    detail: 'Two queens · Sleeps 4 · $280 a night',
    soldOut: true,
  },
  {
    id: 'family',
    name: 'Family suite',
    detail: 'King and bunks · Sleeps 5 · $320 a night',
  },
]

const room = ref<string | undefined>('ocean')
</script>

<template>
  <GhostRadioGroup
    v-model="room"
    default-value="ocean"
    name="room"
    class="room-grid"
  >
    <legend>Room</legend>
    <GhostRadioCard
      v-for="option in rooms"
      :key="option.id"
      :value="option.id"
      :disabled="option.soldOut"
    >
      {{ option.name }}
      <template #description>
        {{ option.soldOut ? 'Sold out for these dates' : option.detail }}
      </template>
    </GhostRadioCard>
  </GhostRadioGroup>
</template>

<style scoped>
.room-grid {
  display: grid;
  gap: var(--ghost-space-gap-md);
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
</style>

Trace:

  1. Mount. room is 'ocean'. The group renders the Ocean suite input checked and that card's root data-state="checked" on the server and the client. The Loft card renders data-disabled and a disabled input.
  2. Click the Family suite's price line. The click lands on the description span inside the Family suite <label>. The label activates its input, which fires change. The item calls the group's select, the group emits update:modelValue with 'family', and room becomes 'family'. Family suite's root gains data-state="checked"; Ocean suite's loses it.
  3. Keyboard. Tab enters the group on the Family suite input; the card shows the focus ring. ArrowUp moves to Ocean suite and selects it. ArrowDown once skips the disabled Loft and lands on Family suite.
  4. Click the disabled Loft card. The label does not activate a disabled input. Nothing changes.
  5. Submit. FormData.get('room') is 'family'.
  6. Reset. A native form reset restores the group's captured defaultValue seed. The example sets default-value="ocean" next to v-model, so the group emits 'ocean', Ocean suite is selected again and the card roots follow. Without a defaultValue, an uncontrolled group clears the selection, and a controlled group emits nothing and keeps the parent's value, as with plain items.
  7. Forced colors. The selected card shows a doubled Highlight border and a Highlight dot. The focused card shows a Highlight outline. The Loft card shows a GrayText border and text.

Several choices with GhostCheckboxGroup ​

The same booking form offers extras:

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

import { GhostCheckboxCard, GhostCheckboxGroup } from '@ghostvue/themes'

type Extra = 'breakfast' | 'late-checkout' | 'parking'

const extras = ref<Extra[]>(['breakfast'])
</script>

<template>
  <GhostCheckboxGroup v-model="extras" name="extras">
    <legend>Extras</legend>
    <GhostCheckboxCard value="breakfast">
      Breakfast
      <template #description>Served 7 to 10 AM · $18 a person</template>
    </GhostCheckboxCard>
    <GhostCheckboxCard value="late-checkout">
      Late checkout
      <template #description>Leave at 2 PM · $30</template>
    </GhostCheckboxCard>
    <GhostCheckboxCard value="parking">
      Parking
      <template #description>Covered garage · $25 a night</template>
    </GhostCheckboxCard>
  </GhostCheckboxGroup>
</template>

Trace:

  1. Mount. extras is ['breakfast']. The Breakfast card's root has data-state="checked" and its input is checked.
  2. Click anywhere on Parking. The label activates the checkbox. The member calls the group's setSelected('parking', true), the group emits ['breakfast', 'parking'] (append order, per the checkbox group spec), and the Parking card shows selected.
  3. Keyboard. Each card is its own tab stop. Space on Breakfast unchecks it; the group emits ['parking'].
  4. Submit. FormData.getAll('extras') is the checked values in DOM order.
  5. Controlled refusal. If the parent ignores an update, the group's member restore step resets the input on the next tick, and the card's data-state follows the unchanged model.

Test plan ​

  • Vue component tests (@ghostvue/vue).
    • Each card renders a <label> root containing exactly one input of the right type, with the group's name.
    • Clicking the root, the label span and the description span each activates the input (@testing-library/user-event or dispatched clicks); clicking a disabled card does not.
    • Root data-state and data-disabled follow controlled, uncontrolled, defaultValue, group disabled and card disabled, including a selected disabled card.
    • Controlled refusal: the root state follows the unchanged model after the input is restored.
    • aria-labelledby points at the label span; aria-describedby includes the description id only when the slot exists and joins a consumer value.
    • A consumer aria-labelledby replaces the generated one.
    • indeterminate on a checkbox card is dropped: the input never shows mixed.
    • Attribute split: class, style and data-visual-state on the root; id, aria-*, other data-* and listeners on the input. A @change listener fires once per activation on both cards, and on a plain GhostRadioGroupItem after the listener fix.
    • Form submission and native reset through both groups with cards, and with cards and plain items mixed in one group.
    • Exposed element, inputElement, focus and blur.
    • Setup throws outside the matching group.
    • Checkbox card keeps the GHOST015, GHOST016 and GHOST017 warnings.
  • Themed wrapper tests (@ghostvue/themes). Wrappers forward props, slots, attributes and the exposed members.
  • Browser tests (Playwright).
    • Room chooser example: click each region of a card, then press Tab, arrow keys and Space, and assert real focus, checked, the root data-state and the submitted value.
    • Checkbox extras example: per-card tab stops and Space toggling.
    • A group inside <fieldset disabled>: cards show the disabled style and ignore clicks, with no data-disabled on the root.
    • Cross-browser radio behavior inherits the existing @cross-browser specs; add one card case to the RTL arrow spec.
    • Forced colors (page.emulateMedia({ forcedColors: 'active' })) screenshot assertions for selected, focused and disabled cards in light and dark.
    • Visual baselines for resting, hover, selected, focus-visible, disabled and invalid-group cards in light and dark.
  • Accessibility tests. axe on both examples and the playground section; assert the computed accessible name equals the default slot text and the description is the accessible description.
  • SSR and hydration. Server-render a selected card and a card with a description; hydrate without mismatch warnings; ids and data-state match.
  • Type tests. The exported components accept value and disabled, reject a missing value, type the description slot, and type the exposed members. A GhostCheckboxGroup<Extra> with cards keeps the Extra[] model type.

Documentation plan ​

  • A Choice cards section on the radio group page with the room chooser example (examples/radio-group/room-chooser.vue).
  • A Choice cards section on the checkbox group page with the extras example (examples/checkbox-group/room-extras.vue).
  • API tables for both cards, generated from their manifests (pnpm docs:api:write).
  • Accessibility notes on both pages: phrasing-only slot content, no links or buttons inside a card, and the name and description wiring.
  • A playground section showing both cards in every state, with unique copy.

Compatibility and release impact ​

  • Additive minor Changesets for @ghostvue/vue and @ghostvue/themes.
  • New manifests at packages/vue/manifests/ghost-radio-card.manifest.json, packages/vue/manifests/ghost-checkbox-card.manifest.json and the matching packages/themes/manifests/ files, with status: experimental. This spec's manifests list is filled in by the build.
  • No change to the existing parts' props, events, exposed members or markup. One listener fallthrough fix on GhostRadioGroupItem: a consumer onChange is chained after the item's own handler instead of being dropped. It belongs in the @ghostvue/vue Changeset as a fix.
  • The cards depend on the internal group contexts. Changes to those contexts must keep the cards' state mirror in step; the component tests above guard it.

Implementation gate ​

The build starts only after this spec merges on master with specStatus: approved and approval evidence. The build must add both cards, their themed wrappers and recipes, manifests, docs sections, examples, playground coverage, tests and Changesets together, and fill in this spec's manifests list in the same change.

Open architectural questions ​

None blocking. Recorded for later, not for v1:

  • A hidden-indicator option, for designs that rely on the card border alone. It would need a non-color selected cue other than the indicator.
  • A standalone GhostCheckboxCard with a boolean model outside a group.
  • A third content slot (for example media or a trailing price) if apps need a layout the label and description regions cannot express.