Radio Card

A card-based radio selection component that provides a more visual way to select from mutually exclusive options.

Anatomy

<script>
  import {
    RadioCard,
    RadioCardRoot,
    RadioCardLabel,
    RadioCardItem,
    RadioCardItemAddon,
  } from "@saas-ui/svelte/components/radio-card";
</script>

<RadioCard.Root>
  <RadioCard.Label>Select a plan</RadioCard.Label>
  <RadioCard.Item value="basic" label="Basic" description="For small teams" />
  <RadioCard.Item value="pro" label="Pro" description="For growing teams">
    <RadioCard.ItemAddon>Most popular</RadioCard.ItemAddon>
  </RadioCard.Item>
</RadioCard.Root>

Examples

Basic Accessibility

Basic radio card group with default styling.

Centered Accessibility

Use the align="center" prop to center content within cards.

Colours Accessibility

Use the colour prop to change the colour of the radio cards.

Controlled Accessibility

Use the value and onValueChange props to control the selected value.

Disabled Accessibility

Use the disabled prop to disable the entire radio card group.

Sizes Accessibility

Use the size prop to change the size of the radio cards.

Vertical Layout Accessibility

Use the orientation="vertical" prop to stack cards vertically.

With Addon Accessibility

Use the addon prop to add content below the card body.

With Icon Accessibility

Pass an icon component to display an icon above the label.

Props

Prop Type Default Description
value text - The controlled value of the radio card group.
size sm | md | lg md The size of the component.
align start | center | end start The alignment of content within cards.
colour gray | red | orange | yellow | green | teal | blue | cyan | purple | pink | rose indigo The colour of the component.
orientation horizontal | vertical horizontal Layout orientation of the items container.
disabled boolean false Whether the component is disabled.
class text - CSS class to apply to the component.