Utilizing default animations with headless tippy
See original GitHub issueDoes 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-contentelement
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.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!