Components
Rich Tooltip
A tooltip card with a title and text.
Pro featureUpgrade to export reports as PDF.
<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.jsonimport { 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
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | The bold first line. | |
body | ReactNode | Text under the title. | |
children | ReactElement | One focusable element. | |
side | "top" | "bottom" | "top" | Where it appears. |
delay | number | 300 | Milliseconds before it shows on hover. |
With reduced motion, it appears without fading.