1. framework components
  2. tooltip

Tooltip

A floating label that appears on hover or focus, providing additional context.

Breaking convention in Skeleton, this component is provided “headless”. Meaning no default styles are applied out of the box. This ensures you retain full control of all styling for maximum flexibility.

Arrow

Visually connects the popover content to the trigger element. Will automatically align based on the selected side.

Z-Index

By default Skeleton does not take an opinionated stance regarding z-index stacking. The result is the component can sometimes be occluded beneath other elements with a higher index. The Z-Index can controlled by applying a utility class to the Positioner component.

Sibling (10)

Provider Pattern

Use the Provider Pattern to gain access to the inner component APIs.

Direction

Set the text direction (ltr or rtl) using the dir prop.

API Reference

Root

PropDefaultType
dir"ltr""ltr" | "rtl" | undefined

The document's text/writing direction.

aria-labelstring | undefined

Custom label for the tooltip.

idsPartial<{ trigger: string; content: string; arrow: string; positioner: string; }> | undefined

The ids of the elements in the tooltip. Useful for composition.

openDelay400number | undefined

The open delay of the tooltip.

closeDelay150number | undefined

The close delay of the tooltip.

closeOnPointerDowntrueboolean | undefined

Whether to close the tooltip on pointerdown.

closeOnEscapetrueboolean | undefined

Whether to close the tooltip when the Escape key is pressed.

closeOnScrolltrueboolean | undefined

Whether the tooltip should close on scroll

closeOnClicktrueboolean | undefined

Whether the tooltip should close on click

interactivefalseboolean | undefined

Whether the tooltip's content is interactive. In this mode, the tooltip will remain open when user hovers over the content.

onOpenChange((details: OpenChangeDetails) => void) | undefined

Function called when the tooltip is opened.

positioningPositioningOptions | undefined

The user provided options used to position the popover content

disabledboolean | undefined

Whether the tooltip is disabled

openboolean | undefined

The controlled open state of the tooltip

defaultOpenboolean | undefined

The initial open state of the tooltip when rendered. Use when you don't need to control the open state of the tooltip.

getRootNode(() => Node | ShadowRoot | Document) | undefined

A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.

childrenSnippet<[]> | undefined

The default slot content to be rendered within the component.

Provider

PropDefaultType
value() => TooltipApi<PropTypes>

childrenSnippet<[]> | undefined

The default slot content to be rendered within the component.

Context

PropDefaultType
childrenSnippet<[() => TooltipApi<PropTypes>]>

Trigger

PropDefaultType
elementSnippet<[HTMLAttributes<"button">]> | undefined

Render the element yourself

Positioner

PropDefaultType
elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Content

PropDefaultType
elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Arrow

PropDefaultType
elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

ArrowTip

PropDefaultType
elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

View page on GitHub