kevingirelli

Segmented Control

Pricing

About

A pill-shaped switch between two or more options with a thumb that slides to the active choice, like "Monthly | Yearly" billing toggles or filter tabs.

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

Code

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

Usage.tsx

import {
  SegmentedControl,
  SegmentedControlItem,
} from "@/components/ui/segmented-control";
import { useState } from "react";

export default function SegmentedControlDemo() {
  const [billing, setBilling] = useState("monthly");

  return (
    <div className="flex min-h-[220px] w-full items-center justify-center bg-background p-10">
      <div className="flex flex-col items-center gap-3">
        <SegmentedControl
          aria-label="Billing period"
          value={billing}
          onValueChange={setBilling}
        >
          <SegmentedControlItem value="monthly">Monthly</SegmentedControlItem>
          <SegmentedControlItem value="yearly">
            Yearly, two months free
          </SegmentedControlItem>
        </SegmentedControl>
        <p className="text-sm text-muted-foreground">
          {billing === "monthly" ? "Billed every month." : "Billed every year."}
        </p>
      </div>
    </div>
  );
}

Dependencies

More by kevingirelli

View all
  • Aurora

    Aurora

    50
  • Warp Gradient

    Warp Gradient

    48
  • FAQ Section

    FAQ Section

    45
  • QR Code

    QR Code

    45
  • Wave Text

    Wave Text

    37
  • Corner Frame

    Corner Frame

    35
  • Animated Border

    Animated Border

    32
  • Spotlight

    Spotlight

    23

More in Pricing

View all
  • Pricing Section

    Pricing Section

    576
  • Pricing Section

    Pricing Section

    173
  • Pricing Card

    Pricing Card

    363
  • Pricing Cards

    Pricing Cards

    85
  • Single Pricing Card

    Single Pricing Card

    793
  • Glowing Pricing Tiers

    Glowing Pricing Tiers

    40
  • pricing section

    pricing section

    157
  • Colorful-Pricing

    Colorful-Pricing

    84