Skip to Content
zjkm-ui
Components

Rich Tooltip

A tooltip card with a title and text.

Props
<RichTooltip title="Pro feature" body="Upgrade to export reports as PDF.">
  <button>Export</button>
</RichTooltip>

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/rich-tooltip.json
import { RichTooltip } from "@/components/rich-tooltip"

Using JavaScript? Set tsx: false in components.json and the CLI converts it.

New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.

Usage

A tooltip card with a bold title and a line or two of text. Like any tooltip it holds text only; for buttons or links, use a popover instead.

import { RichTooltip } from "@/components/rich-tooltip";

export function ExportButton() {
  return (
    <RichTooltip title="Pro feature" body="Upgrade to export reports as PDF.">
      <button>Export</button>
    </RichTooltip>
  );
}

Props

PropTypeDefaultDescription
titlestringThe bold first line.
bodyReactNodeText under the title.
childrenReactElementOne focusable element.
side"top" | "bottom""top"Where it appears.
delaynumber300Milliseconds before it shows on hover.

With reduced motion, it appears without fading.

On this page