Interface: Tooltip
Controller returned by createTooltip().
Methods
getState()
ts
getState(): TooltipState;The current state; the same object until something changes.
Returns
getTooltipProps()
ts
getTooltipProps(id): ElementProps;Props for the tooltip of id: id, role="tooltip", aria-hidden, data-state (open/closed).
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
getTriggerProps()
ts
getTriggerProps(id, options?): ElementProps;Props for a trigger: shows its tooltip on hover (not touch) and focus after the delay, hides on pointer leave, blur and mousedown. Adds aria-describedby only with describe.
Parameters
| Parameter | Type |
|---|---|
id | string |
options? | TooltipTriggerOptions |
Returns
hide()
ts
hide(): void;Hide the visible tooltip at once.
Returns
void
show()
ts
show(id): void;Show the tooltip for id at once, without the delay.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
subscribe()
ts
subscribe(listener): () => void;Call listener on every state change; returns the unsubscribe function.
Parameters
| Parameter | Type |
|---|---|
listener | () => void |
Returns
() => void