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.
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
| Prop | Default | Type |
|---|---|---|
children | — | ReactNode |
dir | "ltr" | "ltr" | "rtl" | undefined The document's text/writing direction. |
aria-label | — | string | undefined Custom label for the tooltip. |
ids | — | Partial<{ trigger: string; content: string; arrow: string; positioner: string; }> | undefined The ids of the elements in the tooltip. Useful for composition. |
openDelay | 400 | number | undefined The open delay of the tooltip. |
closeDelay | 150 | number | undefined The close delay of the tooltip. |
closeOnPointerDown | true | boolean | undefined Whether to close the tooltip on pointerdown. |
closeOnEscape | true | boolean | undefined Whether to close the tooltip when the Escape key is pressed. |
closeOnScroll | true | boolean | undefined Whether the tooltip should close on scroll |
closeOnClick | true | boolean | undefined Whether the tooltip should close on click |
interactive | false | boolean | 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. |
positioning | — | PositioningOptions | undefined The user provided options used to position the popover content |
disabled | — | boolean | undefined Whether the tooltip is disabled |
open | — | boolean | undefined The controlled open state of the tooltip |
defaultOpen | — | boolean | 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. |
Provider
| Prop | Default | Type |
|---|---|---|
value | — | TooltipApi<PropTypes> |
children | — | ReactNode |
Context
| Prop | Default | Type |
|---|---|---|
children | — | (tooltip: TooltipApi<PropTypes>) => ReactNode |
Trigger
| Prop | Default | Type |
|---|---|---|
element | — | ((attributes: HTMLAttributes<"button">) => Element) | undefined Render the element yourself |
Positioner
| Prop | Default | Type |
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself |
Content
| Prop | Default | Type |
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself |
Arrow
| Prop | Default | Type |
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself |
ArrowTip
| Prop | Default | Type |
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself |
Root
| Prop | Default | Type |
|---|---|---|
dir | "ltr" | "ltr" | "rtl" | undefined The document's text/writing direction. |
aria-label | — | string | undefined Custom label for the tooltip. |
ids | — | Partial<{ trigger: string; content: string; arrow: string; positioner: string; }> | undefined The ids of the elements in the tooltip. Useful for composition. |
openDelay | 400 | number | undefined The open delay of the tooltip. |
closeDelay | 150 | number | undefined The close delay of the tooltip. |
closeOnPointerDown | true | boolean | undefined Whether to close the tooltip on pointerdown. |
closeOnEscape | true | boolean | undefined Whether to close the tooltip when the Escape key is pressed. |
closeOnScroll | true | boolean | undefined Whether the tooltip should close on scroll |
closeOnClick | true | boolean | undefined Whether the tooltip should close on click |
interactive | false | boolean | 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. |
positioning | — | PositioningOptions | undefined The user provided options used to position the popover content |
disabled | — | boolean | undefined Whether the tooltip is disabled |
open | — | boolean | undefined The controlled open state of the tooltip |
defaultOpen | — | boolean | 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. |
children | — | Snippet<[]> | undefined The default slot content to be rendered within the component. |
Provider
| Prop | Default | Type |
|---|---|---|
value | — | () => TooltipApi<PropTypes> |
children | — | Snippet<[]> | undefined The default slot content to be rendered within the component. |
Context
| Prop | Default | Type |
|---|---|---|
children | — | Snippet<[() => TooltipApi<PropTypes>]> |
Trigger
| Prop | Default | Type |
|---|---|---|
element | — | Snippet<[HTMLAttributes<"button">]> | undefined Render the element yourself |
Positioner
| Prop | Default | Type |
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself |
Content
| Prop | Default | Type |
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself |
Arrow
| Prop | Default | Type |
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself |
ArrowTip
| Prop | Default | Type |
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself |