Componentform2.79 KB gzipZero dependencies
Radio Cards
Rich selectable radio cards with prices, perks and active ticket border.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add radio-cardsOr install the full npm package:
npm install bigbulluiUsage
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 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| value | string | Controlled selected value |
| defaultValue | string | Initial selected value |
| onValueChange | (value: string) => void | Callback on card selection |
| name | string | Form field name submitted during form serialization. |
| disabled | boolean | Disables interaction and applies disabled styling. (Default: false) |
| orientation | "horizontal" | "vertical" | "grid" | Layout and keyboard navigation axis. (Default: "grid") |
| columns | 1 | 2 | 3 | 4 | Number of grid columns (default 3) |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |
| children | React.ReactNode | Child elements rendered inside the component. |