Tooltip
stableA popup that displays information related to an element when it receives keyboard focus or hover.
Basic usage
Examples
Delayed open
Control open/close delays at the Provider level to reduce visual noise.
Icon toolbar labels
Wrap icon-only controls with Tooltip so the command has an accessible visible hint.
Semantic variants
Tooltip supports themed color variants for contextual hints.
Features
- Opens on hover and on focus.
- Closes on Esc.
- Provider coordinates delay across multiple tooltips.
- Customize side, alignment, offsets, collision handling.
Installation
pnpm dlx structyl add tooltipAPI Reference
Tooltip.Provider
Coordinates delay timing across all tooltips inside it.
| Prop | Type | Default |
|---|---|---|
| delayDuration | numberOpen delay in ms. | 700 |
| skipDelayDuration | numberWindow in which the next tooltip opens instantly. | 300 |
| disableHoverableContent | booleanDisable hovering into tooltip content. | false |
Tooltip.Root
A single tooltip.
| Prop | Type | Default |
|---|---|---|
| open | booleanControlled open state. | — |
| defaultOpen | booleanInitial open state. | — |
| onOpenChange | (open: boolean) => voidCalled when open state changes. | — |
| delayDuration | numberOverride the provider delay. | — |
Tooltip.Trigger
The element that triggers the tooltip.
| Prop | Type | Default |
|---|---|---|
| asChild | booleanMerge props onto the immediate child instead of rendering a default element. | false |
Tooltip.Content
The tooltip popup.
| Prop | Type | Default |
|---|---|---|
| side | 'top' | 'right' | 'bottom' | 'left'Preferred side. | 'top' |
| sideOffset | numberDistance from the trigger. | 0 |
| align | 'start' | 'center' | 'end'Alignment. | 'center' |
Keyboard interactions
| Key | Description |
|---|---|
| Esc | Closes the tooltip. |