Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Radio Cards

ProNew

A radio group whose options are whole cards with a title, a description and a trailing value.

Installation

pnpm dlx shadcn@latest add @viewport/radio-cards

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
title*React.ReactNode

The name of the option.

—
descriptionReact.ReactNode

A line that explains the option.

—
trailingReact.ReactNode

Shown at the end of the card, e.g. a price or a badge.

—
iconReact.ReactNode

Shown before the title instead of the radio dot.

—

Accessibility

  • Each card is the radio button, so the hit area is the whole card.
  • Arrow keys move and select; the group takes a name.
  • Selection changes color only, so the layout never shifts.
  • Respects prefers-reduced-motion.