UI Components
Tooltip
Hover and focus triggered tooltip with four position options
Quick Preview
Installation
// Copy the Tooltip component fromsrc/components/ui/Tooltip.tsx
Usage
import { Tooltip } from '@/components/ui/Tooltip'// Wrap any element โ it becomes the trigger<Tooltip content="Delete this item" position="top"><button aria-label="Delete">๐</button></Tooltip>
Examples
Four Positions
Icon Toolbar
Help Icon
API Key
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
content* | string | - | Tooltip label text |
position | "top" | "bottom" | "left" | "right" | "top" | Tooltip placement relative to trigger |
children* | React.ReactNode | - | The trigger element |
className | string | - | Additional CSS classes for the tooltip |
Features
- โFour positions: top, bottom, left, right
- โMouse hover and keyboard focus triggers
- โrole="tooltip" for accessibility
- โWraps any element as trigger
- โNo external dependencies
- โClient Component