Componentform2.79 KB gzipZero dependencies

Radio Cards

Rich selectable radio cards with prices, perks and active ticket border.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add radio-cards

Or install the full npm package:

npm install bigbullui

Usage

tsx6 lines
import { RadioCards, RadioCard, RadioCardHeader, RadioCardPrice } from "@/components/ui/radio-cards"; <RadioCards defaultValue="vip" columns={2}>  <RadioCard value="std"><RadioCardHeader title="General" /><RadioCardPrice amount="$45" /></RadioCard>  <RadioCard value="vip"><RadioCardHeader title="VIP" /><RadioCardPrice amount="$120" /></RadioCard></RadioCards>

Source code

radio-cards.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxradio-cards.tsx505 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; /* ------------------------------------------------------------------------- * Context & Types * ----------------------------------------------------------------------- */ interface RadioCardsContextValue {  value?: string;  activeTabStop?: string;  name?: string;  disabled?: boolean;  onSelect: (val: string) => void;  registerItem: (id: string, element: HTMLDivElement | null, disabled?: boolean) => void;} 

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { RadioCards } from "@/components/ui/radio-cards"; <RadioCards />
PropTypeDescription
valuestringControlled selected value
defaultValuestringInitial selected value
onValueChange(value: string) => voidCallback on card selection
namestringForm field name submitted during form serialization.
disabledbooleanDisables interaction and applies disabled styling. (Default: false)
orientation"horizontal" | "vertical" | "grid"Layout and keyboard navigation axis. (Default: "grid")
columns1 | 2 | 3 | 4Number of grid columns (default 3)
classNamestringOptional Tailwind or custom CSS classes merged with component styles.
childrenReact.ReactNodeChild elements rendered inside the component.