klyv-ui

Pricing Table

Pricing

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

    98
  • Shader Canvas

    Shader Canvas

    64
  • Klyv Animated Beam

    Klyv Animated Beam

    62
  • Pareto Chart

    Pareto Chart

    58
  • Fluid Canvas

    Fluid Canvas

    42
  • Sunburst Chart

    Sunburst Chart

    34
  • Morphing Text

    Morphing Text

    30
  • Gooey Loader

    Gooey Loader

    29

More in Pricing

View all
  • Pricing Section

    Pricing Section

    693
  • Colorful-Pricing

    Colorful-Pricing

    93
  • Toggleable Add-on Pricing

    Toggleable Add-on Pricing

    206
  • Toggle Pricing Cards

    Toggle Pricing Cards

    93
  • pricing section

    pricing section

    175
  • Pricing Section

    Pricing Section

    201
  • Pricing Card

    Pricing Card

    391
  • Volume Pricing Card

    Volume Pricing Card

    41