Make your AI a shadcn expert

Shadcn Tooltip

React tooltip for hover and focus hints on icon buttons. Built with TypeScript and Tailwind CSS for Next.js using Base UI — sides, shortcuts, and disabled triggers.

The shadcn tooltip is a short label on hover and keyboard focus. Use it for icon-only buttons, truncated cells, and why a control is disabled. It leaves on pointer-out, blur, or Escape.

Scroll to load preview...

Looking for a neobrutalism version for shadcn?

Same tooltip, thicker borders. The NeoBrutalism tooltip is the kit if you want that look.

Usage

import { Button } from "@/components/ui/button"
import {
  Tooltip,
  TooltipContent,
  TooltipTrigger,
} from "@/components/ui/tooltip"
<Tooltip>
  <TooltipTrigger render={<Button variant="outline" />}>
    Hover
  </TooltipTrigger>
  <TooltipContent>
    <p>Add to library</p>
  </TooltipContent>
</Tooltip>

render={<Button />} keeps the Button as the trigger. This wrapper sets delayDuration to 0 — it opens immediately.

Composition

TooltipTrigger
TooltipContent

TooltipProvider is optional. Each Tooltip already wraps one.

Side

side is top, right, bottom, or left. Collision still flips it if the viewport is tight.

Scroll to load preview...

With Keyboard Shortcut

Drop a Kbd in the content. It restyles itself on the inverted tooltip background.

Scroll to load preview...

Disabled Button

Disabled elements do not fire pointer events. Wrap the button in a span and put the trigger on the span.

Scroll to load preview...

RTL

Wrap with DirectionProvider and dir="rtl". side values stay physical — left is still left.

Scroll to load preview...

API

Prop

Type

TooltipContent

Prop

Type

TooltipTrigger takes render. TooltipProvider takes delayDuration and skipDelayDuration.

Keyboard

KeyAction
TabOpen or close without delay
Space / EnterClose without delay if open
EscapeClose without delay if open

Notes

Disabled swallows the pointer

A disabled button does not receive hover or focus. Wrap it in a span and put TooltipTrigger on the span.

Keep the copy to a phrase. A paragraph belongs in a Popover or Hover Card.

With other components

Questions

Was this page helpful?

Sign in to leave feedback.