Tooltip
Tooltip Props
| Name | Type | Default | Description |
|---|---|---|---|
content | string | — | Tooltip text. Use the content slot for rich content. |
placement | 'above' | 'below' | 'start' | 'end' | 'above' | Side of the trigger. Flips when there is no room. |
alignment | 'start' | 'center' | 'end' | 'center' | Alignment along the placement axis. |
delay | number | 200 | Milliseconds before showing on hover. |
hideDelay | number | 0 | Milliseconds before hiding. 0 uses a 100ms bridge so the pointer can reach the bubble. |
focusTrigger | 'auto' | 'always' | 'never' | 'auto' | Whether focus shows the tooltip. auto listens only when the trigger is focusable. |
touchTrigger | 'auto' | 'tap' | 'none' | 'auto' | Tap behavior on touch. auto skips buttons, links, and form controls. |
isEnabled | boolean | true | Disables hover and focus triggers when false. |
hasHoverIndication | 'auto' | boolean | 'auto' | Dashed underline on a text-only trigger. auto applies it only to text. |
isOpen | boolean | — | Controlled visibility. Hover and focus are ignored when set. |
isDefaultOpen | boolean | false | Show on mount. |
Events
openChange(isOpen: boolean): fires when the tooltip shows or hides. WithisOpen, it fires withfalseon Escape and the parent decides whether to close.
Slots
default: the trigger.content: rich tooltip content. Replaces thecontentprop text.
Theme
css
.my-tooltip {
--astryx-tooltip-background: #000;
--astryx-tooltip-foreground: #fff;
}--astryx-tooltip-background: bubble background.--astryx-tooltip-foreground: bubble text color.--astryx-tooltip-indication-color: dashed underline color.--astryx-tooltip-z-index: stacking order of the bubble.