klyv-ui

Pricing Table

Pricing 1

About

A monthly/yearly pricing grid that renders a row of plan cards behind a billing-period toggle, computing the yearly discount from the plan prices and marking the account's current plan.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Pricing Table to your project and fits it to your theme.

Code

How Pricing Table is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import PricingTable, { type PricingPlan } from "@/components/ui/pricing-table";
import { useState } from "react";

const PLANS: PricingPlan[] = [
  {
    id: "free",
    name: "Free",
    description: "For individuals trying things out.",
    monthly: 0,
    yearly: 0,
    features: ["Up to 3 projects", "10k events a month", "Community support"],
    ctaLabel: "Start for free",
  },
  {
    id: "pro",
    name: "Pro",
    description: "For small teams shipping every week.",
    monthly: 24,
    yearly: 19,
    featured: true,
    badge: "Most popular",
    featuresTitle: "Everything in Free, plus",
    features: [
      "Unlimited projects",
      "1M events a month",
      "Workflows and alerts",
      "Email support",
    ],
  },
  {
    id: "team",
    name: "Team",
    description: "For growing teams that need control.",
    monthly: 49,
    yearly: 39,
    featuresTitle: "Everything in Pro, plus",
    features: [
      "SSO with SAML",
      "Roles and permissions",
      "Audit log",
      "Priority support",
    ],
  },
  {
    id: "enterprise",
    name: "Enterprise",
    description: "For organisations with custom needs.",
    monthly: null,
    yearly: null,
    featuresTitle: "Everything in Team, plus",
    features: [
      "Dedicated success manager",
      "99.99% uptime SLA",
      "Custom contract and DPA",
    ],
  },
];

export default function PricingTableDemo() {
  const [chosen, setChosen] = useState<string>();

  return (
    <div className="flex w-full flex-col items-center gap-3 bg-background p-8 text-foreground">
      <PricingTable
        plans={PLANS}
        currentPlanId="free"
        onSelect={(id, period) => setChosen(`${id} · ${period}`)}
      />
      <p className="text-xs text-muted-foreground" aria-live="polite">
        {chosen
          ? `Chose ${chosen}`
          : "The Free plan is marked as current. The saving on the toggle is computed from the plans."}
      </p>
    </div>
  );
}

More by klyv-ui

View all
  • Gantt Chart

    Gantt Chart

    106
  • Shader Canvas

    Shader Canvas

    69
  • Klyv Animated Beam

    Klyv Animated Beam

    68
  • Pareto Chart

    Pareto Chart

    60
  • Fluid Canvas

    Fluid Canvas

    44
  • Sunburst Chart

    Sunburst Chart

    35
  • Time Slot Picker

    Time Slot Picker

    32
  • Morphing Text

    Morphing Text

    32

More in Pricing

View all
  • Pricing Section

    Pricing Section

    715
  • Toggle Pricing Cards

    Toggle Pricing Cards

    101
  • Pricing Card

    Pricing Card

    582
  • pricing section

    pricing section

    183
  • Pricing Section

    Pricing Section

    216
  • Review Stack Pricing

    Review Stack Pricing

    6
  • Single Plan Pricing Card

    Single Plan Pricing Card

    29
  • Toggleable Add-on Pricing

    Toggleable Add-on Pricing

    211