Charcoal UI

Tooltip

Springs out of its trigger. After the first one opens, neighbours open instantly, so scanning a toolbar feels quick.

  • Category: Overlays
  • Licence: Free, MIT
  • Built with: React 19, Tailwind CSS 4, Motion
  • Dependencies: motion, clsx, tailwind-merge

Examples

Tooltip

API reference

PropTypeDefaultDescription
contentReactNode—
side"top" | "bottom" | "left" | "right""top"
delaynumber350
childrenReactElement—A single focusable element.

About Tooltip

Tooltip springs out of its trigger with a short delay, and once one is open its neighbours open instantly, so scanning a toolbar feels quick rather than sluggish.

Tooltip is an overlay component for React 19, styled with Tailwind CSS 4 and animated with Motion. It drops into Next.js, Vite, Remix or Astro through the shadcn CLI as a single file you own.

When to use Tooltip

  • Icon buttons in toolbars.
  • Explaining truncated text.
  • Keyboard shortcut hints.
  • Help icons in forms.

How it works

A shared timer gives the skip-delay behaviour across tooltips. It opens on hover and focus, closes on Escape, and links to its trigger with aria-describedby.

It traps and returns focus correctly, closes on Escape, and is announced to screen readers with the right dialog or menu role. With prefers-reduced-motion on, it holds still or settles instantly instead of animating.

Customizing Tooltip

Every prop is documented in the API reference above with its type and default. The ones you will reach for first are listed here.

The Customize panel next to the preview lets you change side, delay live, and the Code tab updates to match, so the snippet you copy already carries your values.

  • content (ReactNode).
  • side (default "top").
  • delay (number, default 350).

Goes well with Tooltip

These overlays pieces share its tokens and motion language, so they sit together on one page without clashing.

  • Popover: An animated React popover that scales from its trigger and returns focus on close
  • Dialog: An animated React dialog on the native dialog element, with blur and scale transitions
  • Drawer: A React bottom sheet drawer you can fling closed, with rubber-banding at the top
  • Toast: Animated React toasts that stack, fan out on hover and swipe away
  • Sheet: An animated React side sheet on the native dialog element that you can fling closed

Install Tooltip

npx shadcn@latest add https://charcoalui.com/r/tooltip.json

Tooltip is free and MIT licensed. The command copies tooltip.tsx into components/ui and installs clsx, tailwind-merge; you can also copy the source from the Code tab by hand.

It pairs well with Morph Menu, a Pro piece: A button that stretches into its own menu surface, then shrinks back. Arrow keys and Escape work.

Frequently asked questions

Why do neighbouring tooltips open instantly?
Once one tooltip is open, moving to the next skips the delay, which makes scanning a toolbar fast. After a short pause the delay returns.
How do I install Tooltip?
Run npx shadcn@latest add https://charcoalui.com/r/tooltip.json. The shadcn CLI copies tooltip.tsx into components/ui and installs motion, clsx, tailwind-merge. You can also copy the source from this page by hand.
Is Tooltip free for commercial use?
Yes. Tooltip is MIT licensed: use it in any personal or commercial project and change it however you like.
Does Tooltip work with Next.js?
Yes. It is a client component for React 19 styled with Tailwind CSS 4, so it works in the Next.js App Router and Pages Router, Vite, Remix and Astro.
Can an AI coding agent install Tooltip?
Yes. Connect the Charcoal UI MCP server (https://charcoalui.com/mcp) to Claude Code, Cursor or any MCP client; get_component returns Tooltip's props and source and get_install_command returns the exact command.

Tooltip as Markdown · llms.txt