How to use tippyjs with custom attribute (instead of title)
See original GitHub issueHey Guys, 😃
I’m trying to use tippyjs with attribute other than title, something like: selector: [rel-tooltip] tooltip content: [tooltip]
This is my current setup:
tippy('[title]', {
arrow: true,
animation: 'fade',
theme: 'general',
delay: [0, 0],
duration: [0, 0],
maxWidth: '210px',
dynamicTitle: true
});
I’m using the library on chromium app with a lot of dynamic content and pages sometimes between destroy and initialization of the library the default behavior of the title attribute come up and I’m trying to get rid of it.
I tried this with no luck:
tippy('[rel-tooltip]', {
arrow: true,
animation: 'fade',
theme: 'general',
delay: [0, 0],
duration: [0, 0],
maxWidth: '210px',
content: '[tooltip]'
dynamicTitle: true
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to use the title attribute as the content for Tippy.js?
Based on the documentation, you can use reference.getAttribute('title'). Ex.: tippy('#myButton, { content: (reference) => reference.
Read more >FAQ | Tippy.js - GitHub Pages
Can I use the title attribute? Yes. The content prop can be a function that receives the reference element as an argument and...
Read more >Creating Tooltips | Tippy.js
The data-tippy-content attribute allows you to give different tooltip content to many different elements, while only needing to initialize once.
Read more >All Props | Tippy.js
"Props" are configurable properties you can pass optionally to the tippy() constructor ... Determines if content strings are parsed as HTML instead of...
Read more >Tippy.js - Tooltip, Popover, Dropdown, and Menu Library
These themes are included in the package and can be imported separately. light light-border material translucent. #Custom themes. You can apply any CSS...
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

All working great - thanks!
If you want this as default behavior, feel free to “enhance” the tippy function.