structyl

Tooltip

stable

A 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

bash
pnpm dlx structyl add tooltip

API Reference

Tooltip.Provider

Coordinates delay timing across all tooltips inside it.

PropTypeDefault
delayDurationnumber

Open delay in ms.

700
skipDelayDurationnumber

Window in which the next tooltip opens instantly.

300
disableHoverableContentboolean

Disable hovering into tooltip content.

false

Tooltip.Root

A single tooltip.

PropTypeDefault
openboolean

Controlled open state.

defaultOpenboolean

Initial open state.

onOpenChange(open: boolean) => void

Called when open state changes.

delayDurationnumber

Override the provider delay.

Tooltip.Trigger

The element that triggers the tooltip.

PropTypeDefault
asChildboolean

Merge props onto the immediate child instead of rendering a default element.

false

Tooltip.Content

The tooltip popup.

PropTypeDefault
side'top' | 'right' | 'bottom' | 'left'

Preferred side.

'top'
sideOffsetnumber

Distance from the trigger.

0
align'start' | 'center' | 'end'

Alignment.

'center'

Keyboard interactions

KeyDescription
EscCloses the tooltip.
Tooltip | structyl