Choice Card

Selectable React card button with an icon, title and description, using aria-pressed and an accent outline when chosen. Suits plan pickers and onboarding.

src/registry/ui/choice-card.tsx/r/choice-card.json

Installation#

bash
npx shadcn@latest add @minidev/choice-card

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/choice-card.json

Usage#

tsx
import { ChoiceCard } from "@/components/ui/choice-card"

export function Example() {
  return (
    <ChoiceCard title="Personal" description="For solo founders" icon={<UserIcon />} selected={v==="personal"} onClick={() => setV("personal")} />
  )
}

API reference#

ChoiceCard props
PropTypeDefault
title*React.ReactNode-
descriptionReact.ReactNode-
selectedboolean-
iconReact.ReactNode-

Also accepts every prop of <button>, passed through to the root element.

* required

Examples#

All form components

Learn more