useTooltipTriggerState
Manages state for a tooltip trigger. Tracks whether the tooltip is open, and provides methods to toggle this state. Ensures only one tooltip is open at a time and controls the delay for showing a tooltip.
install | yarn add react-stately |
---|---|
version | 3.32.2 |
usage | import {useTooltipTriggerState} from 'react-stately' |
API#
useTooltipTriggerState(
(props: TooltipTriggerProps
)): TooltipTriggerState
Interface#
Properties
Name | Type | Description |
isOpen | boolean | Whether the tooltip is currently showing. |
Methods
Method | Description |
open(
(immediate?: boolean
)): void | Shows the tooltip. By default, the tooltip becomes visible after a delay
depending on a global warmup timer. The |
close(
(immediate?: boolean
)): void | Hides the tooltip. |
Example#
See the docs for useTooltipTrigger in react-aria for an example of useTooltipTriggerState
.