Methods
#Instance methods
Methods on instances allow you to control the tippy programmatically. See the Tippy Instance page for details on accessing an instance.
#show
Programmatically show the tippy at any time:
instance.show(); // Default
instance.show(0); // 0ms transition duration
#hide
Programmatically hide the tippy at any time:
instance.hide(); // Default
instance.hide(500); // 500ms transition duration
#disable
Temporarily prevent a tippy from showing or hiding:
instance.disable();
#enable
Re-enable a tippy:
instance.enable();
#setProps
You can update any prop after the instance has been created. Pass an object of new props in:
instance.setProps({
arrow: true,
animation: 'scale'
});
#setContent
Updating the content
prop has its own method as a shortcut:
instance.setContent('New content');
#destroy
To permanently destroy and clean up the instance, use this method:
instance.destroy();
The _tippy
property is deleted from the reference element upon destruction.
#Static methods
Static methods belong to the tippy
module for global behavior.
#setDefaultProps
Set the default props for each new instance:
tippy.setDefaultProps({
// Props
});
// Access the current default props
tippy.defaultProps;
#hideAll
Hide all visible tippies on the document:
import {hideAll} from 'tippy.js';
// Use each tippy's own duration
hideAll();
// Hide them all instantly
hideAll({duration: 0});
// Hide them all except a particular one
hideAll({exclude: tippyInstance});
hideAll({exclude: referenceElement});
In the CDN (iife
) version, it's available as tippy.hideAll()
.