Skip to main content

Starwind UI v3.0 is now available! Migration guide

Installation

Usage

Positioning

Control the position and alignment of the tooltip using the side and align props.

Delay

Customize the open and close delay using the openDelay and closeDelay props.

Alignment

Control the alignment of the tooltip relative to its trigger using the align prop.

API Reference

Styled Component API

These props are added or materially changed by the installed styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Expand a prop to see named type definitions and framework-specific imports. Follow the Primitive and Runtime links for lower-level behavior props.

Tooltip Trigger

Inherits span attributes.

Contains the following additional props:

Prop Type Default Toggle details
asChild boolean true
Description
Merges the component behavior and props into its child element.
Classification
Primitive override
Primitive prop
tooltip.Trigger.asChild

Tooltip Content

Inherits div attributes. Omits `tabIndex` and `tabindex`.

Contains the following additional props:

Prop Type Default Toggle details
positionerClass string
Description
Adds classes to the generated floating positioner element.
Classification
Wrapper prop

Primitive And Runtime API

Use these references when you need the lower-level behavior APIs behind Tooltip.

Primitive API

Runtime API

Tooltip primitive
createTooltip from @starwind-ui/runtime/tooltip

Changelog

v2.0.2

  • Named the generated aggregate default export so React and Astro tooling can identify the installed component cleanly.

v2.0.0

  • Rebuilt Tooltip on Starwind Runtime for hover and focus timing, floating placement, and dismissal.
  • See the Tooltip Primitive for the underlying unstyled anatomy and behavior API.