Ayman Echakar

Pricing Tab

Pricing 192

About

An animated tab component with support for discount badges. Originally built for Dub.co's pricing frequency selector. Features - Smooth layout animations using Framer Motion - Optional discount badge support - Selected state with animated background - Dark mode support - Customizable text and callbacks

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

Code

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

Usage.tsx

"use client"

import * as React from "react"
import { Tab } from "@/components/ui/pricing-tab"

const FREQUENCIES = ["monthly", "yearly"]

export function TabDemo() {
  const [selected, setSelected] = React.useState(FREQUENCIES[0])

  return (
    <div className="flex flex-col items-center gap-8 p-6">
      <div className="space-y-2 text-center">
        <h3 className="text-2xl font-bold">Simple Pricing</h3>
        <p className="text-muted-foreground">
          Choose the best plan for your needs
        </p>
      </div>
      
      <div className="flex w-fit rounded-full bg-muted p-1">
        {FREQUENCIES.map((frequency) => (
          <Tab
            key={frequency}
            text={frequency}
            selected={selected === frequency}
            setSelected={setSelected}
            discount={frequency === "yearly"}
          />
        ))}
      </div>
    </div>
  )
}

Dependencies

More by Ayman Echakar

View all
  • Pricing Section

    Pricing Section

    1.6K
  • User Dropdown

    User Dropdown

    910
  • Blog Posts

    Blog Posts

    363
  • Pricing Card

    Pricing Card

    8
  • Toast

    Toast

  • Authentication Modal

    Authentication Modal

More in Pricing

View all
  • Pricing Section

    Pricing Section

    582
  • Pricing Cards

    Pricing Cards

    31
  • Pricing Card

    Pricing Card

    535
  • Pricing Section

    Pricing Section

    173
  • pricing section

    pricing section

    158
  • Single Pricing Card

    Single Pricing Card

    795
  • Pricing

    Pricing

    125
  • Glowing Pricing Tiers

    Glowing Pricing Tiers

    45