Tooltip
A label for a control that has no visible text.
Default
A tooltip must never carry information you cannot get any other way — this one repeats the icon button's own `aria-label`, word for word.
Usage
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from '@oceanic-hub/brand-system'<TooltipProvider>
<Tooltip>
<TooltipTrigger>…</TooltipTrigger>
<TooltipContent>…</TooltipContent>
</Tooltip>
</TooltipProvider>Composition
Use the following composition to build a Tooltip:
TooltipProvider
└── Tooltip ×4
├── TooltipTrigger
└── TooltipContentA tooltip may only repeat or name — never carry information available nowhere
else, because it is unreachable on touch and easy to miss with a keyboard. An icon button's
tooltip should say the same thing as its aria-label. A keyboard shortcut is the one common
exception: the control still works, and still says what it does, with no shortcut shown at
all — the Kbd in the content is a bonus for a reader who already knows the action, not the
only place it is named.
Content is inert — a label, never something to click or focus. If what is behind the trigger
may itself be interactive, that is a HoverCard; if it should open on click rather than
hover, it is a Popover.
With a shortcut
A keyboard shortcut is the one common exception to "never new information": the button still works, and still says what it does, with no shortcut at all — the Kbd is a bonus for a reader who already knows the action, not the only place it is named.
Side
side places the content against the trigger. Radix flips it automatically when the placed side runs out of room, so this is a starting position, not a promise.
Disabled trigger
A disabled element fires no pointer events, so the tooltip never opens on it. Wrap it in a span so the span is the trigger and the button stays visually and semantically disabled.
API Reference
See the Tooltip API page for every prop of every part, with types, defaults and the contract that pins them.