Pricing table
Pricing tiers with a monthly/yearly switch that works without JavaScript.
Preview
Switching the period rolls each price to its new value. With reduced motion turned on, it renders the plain layout.
Simple pricing
Sample prices.
Hobby
For side projects
$0per month$0per year
- 1 project
- Community support
Pro
Most popularFor growing products
$19per month$190per year
- 10 projects
- Feature reports
- Email support
Team
For companies
$49per month$490per year
- Unlimited projects
- SSO
- Priority support
Simple pricing
Sample prices.
Hobby
For side projects
$0per month$0per year
- 1 project
- Community support
Pro
Most popularFor growing products
$19per month$190per year
- 10 projects
- Feature reports
- Email support
Team
For companies
$49per month$490per year
- Unlimited projects
- SSO
- Priority support
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { PricingTable } from "@/components/custom/pricing-table";
<PricingTable
title="Simple pricing"
yearlyNote="2 months free"
plans={[
{ name: "Pro", monthly: 19, yearly: 190, popular: true,
features: ["10 projects"], cta: { label: "Start trial", href: "/signup" } },
]}
/>import { PricingTableMotion } from "@/components/custom/pricing-table/pricing-table-motion";
<PricingTableMotion title="Simple pricing" plans={plans} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| plans* (required) | PricingPlan[] | – | { name, description?, monthly, yearly, features, cta: { label, href, yearlyHref? }, popular? }. yearlyHref is used while Yearly is selected, such as a yearly checkout link. |
| title | string | "Pricing" | Heading (h2). |
| description | string | – | Line under the heading. |
| currency | string | "$" | Symbol before prices. |
| monthlyLabel / yearlyLabel | string | "Monthly" / "Yearly" | Switch labels. |
| yearlyNote | string | – | Note beside the switch, such as “2 months free”. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| plans* (required) | PricingPlan[] | – | { name, description?, monthly, yearly, features, cta: { label, href, yearlyHref? }, popular? }. yearlyHref is used while Yearly is selected, such as a yearly checkout link. |
| title | string | "Pricing" | Heading (h2). |
| description | string | – | Line under the heading. |
| currency | string | "$" | Symbol before prices. |
| monthlyLabel / yearlyLabel | string | "Monthly" / "Yearly" | Switch labels. |
| yearlyNote | string | – | Note beside the switch, such as “2 months free”. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- The period switch is a labelled radio group and works without JavaScript.
- Prices read as “$19 per month”.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.