MCPcopy Index your code
hub / github.com/adobe/react-spectrum / useTooltip

Function useTooltip

packages/react-aria/src/tooltip/useTooltip.ts:35–48  ·  view source on GitHub ↗
(props: AriaTooltipProps, state?: TooltipTriggerState)

Source from the content-addressed store, hash-verified

33 * Provides the accessibility implementation for a Tooltip component.
34 */
35export function useTooltip(props: AriaTooltipProps, state?: TooltipTriggerState): TooltipAria {
36 let domProps = filterDOMProps(props, {labelable: true});
37
38 let {hoverProps} = useHover({
39 onHoverStart: () => state?.open(true),
40 onHoverEnd: () => state?.close()
41 });
42
43 return {
44 tooltipProps: mergeProps(domProps, hoverProps, {
45 role: 'tooltip'
46 })
47 };
48}

Callers 4

TestFunction · 0.90
TooltipFunction · 0.85
TooltipInnerFunction · 0.85
Tooltip.tsxFile · 0.85

Calls 5

filterDOMPropsFunction · 0.90
useHoverFunction · 0.90
mergePropsFunction · 0.90
openMethod · 0.65
closeMethod · 0.65

Tested by 2

TestFunction · 0.72
TooltipFunction · 0.68