question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Utilizing default animations with headless tippy

See original GitHub issue

Does headless tippy support the default animations?

I’ve tried utilizing the default animations with headless tippy to no avail.

I noticed that in the examples for headless animation [1][2] that animation takes a boolean prop instead of the animation name (e.g. shift-towards-subtle).

This is a contrived example to illustrate what I’m trying to do:

 <Tippy
        render={attrs => (
          <div className="tippy-box" data-animation="shift-towards-subtle" {...attrs}>
            <div className="tippy-content">
              {this.props.content}
            </div>
            <div data-popper-arrow="" className="tippy-arrow" />
          </div>
        )}
      >
        <span>I'm a tooltip!</span>
      </Tippy>

I’ve tried setting data-animation AND animation attributes on:

  • Tippy
  • inside of render
  • and on .tippy-content element

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
atomikscommented, Apr 21, 2020

Working version: https://codesandbox.io/s/sharp-wave-gj92x?file=/src/App.js

Looks like transitionDuration: this.state.isVisible ? '400ms' : '0' is the important part.

0reactions
ryanjmackcommented, Apr 21, 2020

Beautiful! It worked!

The reason we’re going headless is because we need granular control over the class names that are applied to the elements that compose the tooltip.

We use CSS modules and rename our classes in our prod build pipeline. When we used the previous version of tippy-react, we had to modify our build tasks and use global css selectors for tippy-* classes. It sufficed, but with headless we can get rid of those workarounds and remove a dependency in our build pipeline!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Headless Tippy | Tippy.js
When using Headless Tippy, animations are not enabled ( animation: false ) by default. To enable animations, set animation: true (or a string...
Read more >
Animations | Tippy.js
Tippies use an opacity fade transition by default. #Included animations. The package comes with extra animations for you to use: shift-away; shift-toward ...
Read more >
Animations with Tailwind CSS using Transition from Headless UI
Create animated form input elements in a slide-over panel and animate elements when entering the viewport using Tailwind CSS and Headless UI Transitions....
Read more >
React component for Tippy.js - Morioh
Default Tippy is very quick to use and setup and “just works” out of the box. Headless Tippy. Render your own tippy element...
Read more >
@tippyjs/react - npm
Tippy.js is the complete tooltip, popover, dropdown, and menu solution for ... animation={false} as a default prop instead of using the /headless import....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found