All components
Chewypixel component

Tooltip

A tooltip on a frosted panel that scales in from its trigger and fades out when you move away.

Installation

npx shadcn@latest add https://chewypixel.io/r/tooltip.json

Usage

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

export function ShareButton() {
  return (
    <Tooltip>
      <TooltipTrigger asChild>
        <Button variant="outline">Share</Button>
      </TooltipTrigger>
      <TooltipContent>Copy a link to this page</TooltipContent>
    </Tooltip>
  );
}

Props

side

Which side of the trigger it opens on. Goes on TooltipContent.

"top" | "right" | "bottom" | "left" = "top"

sideOffset

The gap between the trigger and the tooltip, in pixels. Goes on TooltipContent.

number = 6

delayDuration

How long to hover before it opens, in milliseconds. Goes on Tooltip or TooltipProvider.

number = 0

Released under the MIT License.

More components

See them in a real app

These components come from Mochi, our admin dashboard template built with Next.js, shadcn/ui and Motion.