How to use the reakit.useTooltipState function in reakit

To help you get started, we’ve selected a few reakit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github btzr-io / Villain / packages / villain-react / src / components / tooltip.js View on Github external
({ title, children, placement = 'top', ...props }, ref) => {
    const tooltipState = useTooltipState({ placement, unstable_animated: true })

    const handleAnimationRest = () => {
      tooltipState.unstable_stopAnimation()
    }

    const [{ opacity }, updateTooltipSpring, stopTooltipSpring] = useSpring(() => ({
      delay: 0,
      opacity: 0,
      onRest: handleAnimationRest,
      config: { clamp: true, velocity: 14, friction: 20 },
    }))

    // Update tooltip placement
    useEffect(() => {
      tooltipState.place(placement)
    }, [placement])
github reakit / reakit / stories / index.stories.tsx View on Github external
const Example = () => {
    const tooltip = useTooltipState({ visible: true });
    return (
      
        
          Reference
        
        
          
          Tooltip
        
      
    );
  };
  return ;
github reakit / reakit / packages / website / src / components / DocsNavigation.tsx View on Github external
function ExperimentalLink(props: GatsbyLinkProps<{}>) {
  const { unstable_referenceRef, ...tooltip } = useTooltipState({
    placement: "right",
    unstable_fixed: true
  });
  return (
    <>
      
        {props.children}
        
      
      
         Experimental
      
    
  );
}