Skip to content

Components

Tooltip

A short glass hint on hover or keyboard focus, describing its trigger to screen readers; below its trigger or beside it.

Import

import { Tooltip, TooltipTrigger, TooltipContent } from '@rinzai/zen';

Examples

Beside

An icon rail, each icon's name in a tooltip beside it (side="beside"), clear of the icons below. The name is the button's own label, so it isn't also its description.

API reference

<Tooltip>

A short hint shown while the pointer is over its trigger or the trigger has keyboard focus; Escape hides it. The trigger is described by it for screen readers. Put a TooltipTrigger and a TooltipContent inside. For anything to click or fill in, use Popover.

No props of its own; it accepts the props of the element it renders.

<TooltipTrigger>

What the tooltip describes: a button by default. With asChild, your own focusable element instead.

PropTypeDefault
asChild

Put the trigger's props on your own focusable element instead of rendering a button.

boolean—

<TooltipContent>

The hint: glass, below the trigger (above it if there's no room), centred on it by default. side="beside" puts it after the trigger instead (before it if there's no room), as for the icons of a collapsed sidebar.

PropTypeDefault
align

Centred on the trigger (default), or lined up with its start or end edge (beside: its top or bottom).

"center" | "end" | "start"center
offset

Gap from the trigger, in px.

number5
side

Below the trigger (default; above if there's no room), or beside it (after it; before if there's no room).

"below" | "beside"below