|$ curl https://forge-ai.dev/api/markdown?path=docs/components/tooltips
$cat docs/tooltips.md
updated Recently·10 min read·published

Tooltips

CSSHTMLUIIntermediate

Pure CSS tooltips with positioning variants, rich content, and interactive hover triggers.

Position Variants

Tooltips positioned above, below, left, and right of the trigger element using CSS data attributes.

positions
Live
untitled.html
HTML
1<div class="wrapper">
2 <div class="tooltip-wrap" data-tooltip="Top tooltip — short info">
3 <button class="trigger">
4 Top
5 </button>
6 </div>
7 <div class="tooltip-wrap bottom" data-tooltip="Bottom tooltip description">
8 <button class="trigger">
9 Bottom
10 </button>
11 </div>
12 <div class="tooltip-wrap left" data-tooltip="Left side">
13 <button class="trigger">
14 Left
15 </button>
16 </div>
17 <div class="tooltip-wrap right" data-tooltip="Right side">
18 <button class="trigger">
19 Right
20 </button>
21 </div>
22</div>
preview
Rich Content

Tooltips with HTML content — multiple lines, colored text, and icons.

rich
Live
untitled.html
HTML
1<div class="wrapper">
2 <div class="rich-tip">
3 <button class="trigger">
4 Hover me
5 </button>
6 <div class="rich-content">
7 <div class="rich-header">
8 <svg viewBox="0 0 24 24" fill="none" stroke="#00FF41" stroke-width="2" width="14" height="14">
9 <circle cx="12" cy="12" r="10"/>
10 <line x1="12" y1="16" x2="12" y2="12"/>
11 <line x1="12" y1="8" x2="12.01" y2="8"/>
12 </svg>
13 <span>
14 Information
15 </span>
16 </div>
17 <p class="rich-body">
18 This tooltip supports multiple lines of content with detailed explanations and visual elements.
19 </p>
20 <div class="rich-footer">
21 <span class="badge">
22 Updated
23 </span>
24 <span>
25 2 mins ago
26 </span>
27 </div>
28 </div>
29 </div>
30 <div class="rich-tip left">
31 <button class="trigger">
32 Details
33 </button>
34 <div class="rich-content">
35 <div class="rich-header">
36 <svg viewBox="0 0 24 24" fill="none" stroke="#00FF41" stroke-width="2" width="14" height="14">
37 <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
38 </svg>
39 <span>
40 Status
41 </span>
42 </div>
43 <p class="rich-body">
44 All systems operational. No incidents reported in the last 24 hours.
45 </p>
46 </div>
47 </div>
48</div>
preview
Interactive Delay

Tooltips with show/hide delay for better UX — instant on desktop, delayed on mobile.

delay
Live
untitled.html
HTML
1<div class="wrapper">
2 <div class="delay-tip" data-delay="200">
3 <button class="trigger">
4 200ms delay
5 </button>
6 <span class="delay-msg">
7 Appears after 200ms
8 </span>
9 </div>
10 <div class="delay-tip" data-delay="500">
11 <button class="trigger">
12 500ms delay
13 </button>
14 <span class="delay-msg">
15 Appears after 500ms
16 </span>
17 </div>
18 <div class="delay-tip" data-duration="3000">
19 <button class="trigger">
20 Auto-hide 3s
21 </button>
22 <span class="delay-msg">
23 Hides after 3 seconds
24 </span>
25 </div>
26</div>
preview