RadioCards

Single-choice cards. One tinted pill slides to the card you pick while its round marker fills and ticks. Optional icon, meta text and columns. Inputs.

Open playground

About

RadioCards is a React component in the Inputs category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { RadioCards } from "@ashutoshswamy/smoui" and set columns, options[].icon, options among its 6 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { RadioCards } from "@ashutoshswamy/smoui";

<RadioCards label="Delivery" options={[{ value: "standard", label: "Standard" }, { value: "express", label: "Express" }]} onChange={setDelivery} />

Props 6

columns

Cards per row. Default 1.

123
options[].icon / meta

A leading icon and right-hand text such as a price.

IconName / string
options

Choices.

{ value: string; label: string; description?: string; disabled?: boolean }[]
label

Accessible group name.

string
value / defaultValue

Controlled or initial option value.

string
onChange

Called on selection.

(value: string) => void