Preet Suthar

Tooltip

Buttons 11

About

A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.

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

Code

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

Usage.tsx

import {
  Tooltip,
  TooltipContent,
  TooltipProvider,
  TooltipTrigger,
} from "@/components/ui/tooltip";
import { Button } from "@/components/ui/button"

export default function DemoOne() {
  return (
    <>
      <TooltipProvider>
        <div className="flex gap-4 flex-wrap items-center">
          <Tooltip>
            <TooltipTrigger asChild>
              <Button variant="outline">Hover me</Button>
            </TooltipTrigger>
            <TooltipContent>
              <p>This is a tooltip</p>
            </TooltipContent>
          </Tooltip>
          <Tooltip>
            <TooltipTrigger asChild>
              <Button variant="default">Dark tooltip</Button>
            </TooltipTrigger>
            <TooltipContent variant="dark">
              <p>Dark variant tooltip</p>
            </TooltipContent>
          </Tooltip>
        </div>
      </TooltipProvider>
    </>
  );
}

Dependencies

More by Preet Suthar

View all
  • Modern & Stunning sign in

    Modern & Stunning sign in

    1.9K
  • Shining Text

    Shining Text

    1.7K
  • Magic Text

    Magic Text

    935
  • Toolbar

    Toolbar

    878
  • Hero 2

    Hero 2

    877
  • Typewriter Text

    Typewriter Text

    824
  • AI Chat Input

    AI Chat Input

    807
  • Full Screen Signup

    Full Screen Signup

    781

More in Buttons

View all
  • Button

    Button

    166
  • Texture Button

    Texture Button

    121
  • Button

    Button

    21
  • Figma File Button

    Figma File Button

    39
  • Native Button

    Native Button

    12
  • Button

    Button

    88
  • HeroUI Button Group

    HeroUI Button Group

    11
  • Great UI Button

    Great UI Button

    19