klyv-ui

Pricing Table

Pricing 2

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

    117
  • Klyv Animated Beam

    Klyv Animated Beam

    76
  • Shader Canvas

    Shader Canvas

    75
  • Pareto Chart

    Pareto Chart

    65
  • Fluid Canvas

    Fluid Canvas

    48
  • Time Slot Picker

    Time Slot Picker

    41
  • Sunburst Chart

    Sunburst Chart

    37
  • Klyv Border Beam

    Klyv Border Beam

    33

More in Pricing

View all
  • Pricing Section

    Pricing Section

    733
  • Pricing Section 1

    Pricing Section 1

    109
  • Executive Pricing Plan

    Executive Pricing Plan

    20
  • Single Pricing Card

    Single Pricing Card

    829
  • Toggleable Add-on Pricing

    Toggleable Add-on Pricing

    228
  • Pricing Card

    Pricing Card

    408
  • Review Stack Pricing

    Review Stack Pricing

    10
  • Toggle Pricing Cards

    Toggle Pricing Cards

    112