Cnippet

Feature Gate Tooltip

Component 17

About

A tooltip toolbar of icon buttons where locked Pro features show a rich tooltip with a Pro badge, description, and upgrade link.

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

Code

How Feature Gate Tooltip is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import {
  ArrowRightIcon,
  CrownIcon,
  ImageIcon,
  PaletteIcon,
  PlugIcon,
  SparklesIcon,
  ZapIcon,
} from "lucide-react";
import { Badge } from "@/components/ui/v-tooltip-12-utils/badge";
import { Button } from "@/components/ui/v-tooltip-12-utils/button";
import {
  Tooltip,
  TooltipContent,
  TooltipProvider,
  TooltipTrigger,
} from "@/components/ui/v-tooltip-12-utils/tooltip";

type Feature = {
  icon: React.ElementType;
  label: string;
  description: string;
  pro: boolean;
};

const features: Feature[] = [
  {
    description: "Automate repetitive tasks",
    icon: ZapIcon,
    label: "Automations",
    pro: false,
  },
  {
    description: "Browse and insert media",
    icon: ImageIcon,
    label: "Media Library",
    pro: false,
  },
  {
    description: "Build custom color themes",
    icon: PaletteIcon,
    label: "Custom Themes",
    pro: true,
  },
  {
    description: "Connect third-party tools",
    icon: PlugIcon,
    label: "Integrations",
    pro: true,
  },
  {
    description: "Generate content with AI",
    icon: SparklesIcon,
    label: "AI Assist",
    pro: true,
  },
];

export default function FeatureGateTooltipDemo() {
  return (
    <div className="flex min-h-40 items-center justify-center">
      <TooltipProvider>
        <div className="flex items-center gap-1 rounded-lg border bg-background p-1 shadow-xs">
          {features.map(({ icon: Icon, label, description, pro }) => (
            <Tooltip key={label} defaultOpen={label === "Custom Themes"}>
              <TooltipTrigger
                render={
                  <Button
                    aria-label={label}
                    className={pro ? "opacity-40" : ""}
                    size="icon"
                    variant="ghost"
                  />
                }
              >
                <Icon aria-hidden="true" className="size-4" />
              </TooltipTrigger>
              <TooltipContent className={pro ? "p-3" : undefined}>
                {pro ? (
                  <div className="space-y-1.5">
                    <div className="flex items-center gap-2">
                      <span className="font-medium">{label}</span>
                      <Badge className="gap-1" size="sm" variant="outline">
                        <CrownIcon aria-hidden="true" className="size-2.5" />
                        Pro
                      </Badge>
                    </div>
                    <p className="text-muted-foreground">{description}.</p>
                    <a
                      className="flex items-center gap-1 font-medium text-primary underline-offset-2 hover:underline"
                      href="#"
                    >
                      Upgrade to Pro
                      <ArrowRightIcon aria-hidden="true" className="size-3" />
                    </a>
                  </div>
                ) : (
                  label
                )}
              </TooltipContent>
            </Tooltip>
          ))}
        </div>
      </TooltipProvider>
    </div>
  );
}

Dependencies

More by Cnippet

View all
  • Team

    Team

    1.3K
  • Davincho Hero-1

    Davincho Hero-1

    683
  • Aero Hero-3

    Aero Hero-3

    559
  • Features

    Features

    510
  • Random Letter Swap Navigation

    Random Letter Swap Navigation

    487
  • Services with Animated Hover Modal

    Services with Animated Hover Modal

    465
  • Blogs

    Blogs

    396
  • Aero Hero-1

    Aero Hero-1

    356

Explore more

Part of Cnippet — browse the full library on 21st.dev.