Tooltip
tooltipA short description of a control, shown on hover and on keyboard focus, with an optional arrow. Built on the Base UI primitive and portalled so a tooltip is never clipped by the toolbar or table it belongs to.
import { Bell, Copy, Info, Settings, Trash2 } from "lucide-react";
import { Button } from "@/components/forme/button/button";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/forme/tooltip/tooltip";
export function TooltipDemo() {
return (
<TooltipProvider>
<div className="flex flex-col gap-8">
<div className="flex flex-wrap items-center gap-3">
<Tooltip>
<TooltipTrigger asChild>
<Button variant="secondary" iconOnly leadingIcon={Copy} aria-label="Copy link" />
</TooltipTrigger>
<TooltipContent>Copy link</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="secondary" iconOnly leadingIcon={Bell} aria-label="Notifications" />
</TooltipTrigger>
<TooltipContent>Three unread build notifications</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="secondary"
iconOnly
leadingIcon={Settings}
aria-label="Workspace settings"
/>
</TooltipTrigger>
<TooltipContent>Workspace settings</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="secondary"
iconOnly
leadingIcon={Trash2}
aria-label="Delete deployment"
/>
</TooltipTrigger>
<TooltipContent>Deployments can be restored for thirty days</TooltipContent>
</Tooltip>
</div>
<div className="flex flex-wrap items-center gap-3">
<Tooltip>
<TooltipTrigger asChild>
<Button variant="ghost" size="small" leadingIcon={Info}>
Read the changelog
</Button>
</TooltipTrigger>
<TooltipContent>
Triggers are real buttons, so Tab reaches them and focus shows the tooltip too
</TooltipContent>
</Tooltip>
</div>
</div>
</TooltipProvider>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
Usage
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/forme/tooltip/tooltip";
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button iconOnly leadingIcon={Copy} aria-label="Copy" />
</TooltipTrigger>
<TooltipContent>Copy</TooltipContent>
</Tooltip>
</TooltipProvider>When to use
Reach for it
- Naming an icon-only control, or adding a short hint to something already labelled.
Use something else
- Anything essential. A tooltip cannot be reached by touch, so the information must exist elsewhere.
- Interactive content like links or buttons — that is a
Popover.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
TooltipTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — | Render as the single child element instead of a <button>, keeping the trigger behaviour. |
Also takes every prop of Base UI Tooltip.Trigger.
TooltipContent
| Prop | Type | Default | Description |
|---|---|---|---|
arrow | boolean | true | The caret pointing at the trigger. On by default; the popup grows out of it. |
Also takes every prop of Base UI Tooltip.Popup and Pick<ComponentProps<typeof TooltipPrimitive.Positioner>, "side" | "sideOffset" | "align">.
The other parts
TooltipProviderTakes Base UITooltip.ProviderTooltipTakes Base UITooltip.RootTooltipArrowTakes Base UITooltip.Arrow
Accessibility
- It opens on keyboard focus as well as hover.
- It describes its trigger; an icon-only trigger still needs its own
aria-label.
Motion
- It opens after 200ms. Once one has shown, its neighbours open instantly while the pointer travels between them.
Related


Popover
A small surface anchored to a trigger, with a title and a description that Base UI wires into the accessibility tree so the popover is announced with a name. Collision-aware placement, portalled so it escapes overflow, and a Close part for the explicit way out.
overlays

Dialog
A modal built on the Base UI primitive, so the focus trap, the inert background, Esc to close and the return of focus all come from one well tested place. The backdrop fades and the panel scales in, both in and out, and everything comes from the foundation tokens.
overlays

Drawer
A bottom sheet on the Base UI dialog, so it keeps the focus trap, Esc and focus return. Drag it down by the handle or header and it follows your finger, then springs back or closes when pulled past a third of its height or flicked.
overlays