PlanPicker

Plans as a radio list. One tinted block glides to the chosen plan, the radio fills with a pop and arrow keys move the choice. Pricing.

Open playground

About

PlanPicker is a React component in the Pricing category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { PlanPicker } from "@ashutoshswamy/smoui" and set plans, value, currency.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

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

<PlanPicker defaultValue="pro" plans={[{ id: "free", name: "Free", price: 0 }, { id: "pro", name: "Pro", price: 19, badge: "Popular" }]} onChange={(id) => setPlan(id)} />

Props 3

plans

Price is a number in whole units.

{ id; name; price; description?; badge? }[]
value / defaultValue / onChange

Selected plan.

string / string / (id) => void
currency / period

Price affixes.

stringdefault "$" / "/mo"