Overlays
Tooltip
A short label for icon-only or ambiguous controls.
Installation
Copy the source with the CLI to own and edit it, or import it from the npm package.
npx aback-ui@latest add tooltipWrites components/ui/tooltip.tsx. First time in this project? Run npx aback-ui@latest init first, as the installation guide shows.
Usage
Import the parts you need from the installed file. The Code tab above has a complete, working example.
import {
Tooltip,
TooltipTrigger,
TooltipContent,
TooltipProvider,
} from "@/components/ui/tooltip";API reference
Props and composition points for Tooltip. Native element props pass through.
| Prop | Type | Default | Description |
|---|---|---|---|
delayDuration | number | 200 | Milliseconds before the tooltip appears. |
side / align / sideOffset | Radix placement props | sideOffset="6" | Position relative to the trigger. |
TooltipContent | component | None | The short label. Render through a portal so it escapes overflow. |
Dependencies: radix-ui, plus the shared @/lib/utils helper.
Accessibility
Semantics, keyboard behavior, and the decisions that keep the component operable.
- The tooltip is supplementary. The trigger still needs its own accessible name.
- Focus or hover reveals it, and Escape dismisses it without moving focus.
- Never put interactive content or essential instructions in a tooltip.
- Keep the label short and match the visible action verb.
Keyboard
| Key | Action |
|---|---|
| Tab | Focus the trigger and reveal the tooltip. |
| Escape | Dismiss the tooltip while focus stays on the trigger. |
Used in production
The Aback products whose interfaces shaped this component.
This component is new in Aback UI. It has not shipped in an Aback product yet, so no production use is claimed.