overlaystooltip
Tooltip
Hover-triggered informational overlay anchored to a trigger element.
Import#
Slot Structure#
Wrapper trigger with a floating content portal containing text and optional keyboard hints.
Examples#
Placements#
Tooltip positioned on each side.
Trigger Types#
Tooltip on buttons and inline text.
Keyboard Shortcuts#
Display keyboard shortcut hints alongside tooltip text.
Text Only vs Shortcuts Only#
Content variations.
API Reference#
Attributes#
Slot
content6 attributesTooltip bubble positioned next to its trigger.
CSS Variables
| CSS Variable | Description |
|---|---|
| --mo-popper-content-transform-origin | CSS custom property exposed by this slot. |
Data Attributes
| Data Attribute | Description |
|---|---|
| data-placement | State or slot attribute exposed for styling hooks and selectors. |
ARIA Attributes
| ARIA Attribute | Description |
|---|---|
| aria-describedby | References descriptive text associated with the control. |
| aria-labelledby | References the element that labels the control or region. |
| aria-modal | Identifies modal content that traps interaction outside the dialog. |
| role | Defines the semantic role exposed to assistive technology. |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
| children | JSX.Element | — | The reference element that triggers the tooltip. |
| class | ClassValue | — | Class applied to the component root or trigger element. |
| classes | TooltipT.Classes | undefined | — | — |
| closeDelay | number | undefined | 200 | Delay in milliseconds before closing after leaving trigger or content. |
| defaultOpen | boolean | undefined | — | — |
| disabled | boolean | undefined | — | — |
| forceMount | boolean | undefined | — | — |
| id | string | undefined | — | — |
| instantOpenDelay | number | undefined | 300 | Delay in milliseconds to skip the open delay for the next trigger after closing. |
| invert | boolean | undefined | — | — |
| kbds | string[] | undefined | — | Keyboard shortcuts to display next to the text. |
| onOpenChange | ((open: boolean) => void) | undefined | — | — |
| open | boolean | undefined | — | — |
| openDelay | number | undefined | 600 | Delay in milliseconds before opening on hover or focus. |
| placement | Placement | undefined | — | — |
| ref | JSX.HTMLElementTags["span"] extends { ref?: infer Ref; } ? Ref : never | undefined | — | — |
| side | "bottom" | "top" | "right" | "left" | undefined | — | — |
| style | JSX.CSSProperties | undefined | — | — |
| styles | TooltipT.Styles | undefined | — | — |
| text | JSX.Element | — | Primary text content or element to display. |