There are two ways to install the package.
#1. Package Manager
# npm npm i tippy.js # Yarn yarn add tippy.js
In your application, import the
tippy module, and the core CSS:
import tippy from 'tippy.js'; import 'tippy.js/dist/tippy.css';
This assumes you're using a module bundler like webpack, Rollup, or Parcel. If
you're getting an error message about
process inside the browser,
see the FAQ for help.
The core CSS is not required, but provides a base styling for you to use, and enables "click outside" behavior on iOS. If you'd like to use Tippy "headless" without any of the default element rendering or CSS, use Headless Tippy.
<!-- Development --> <script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.min.js"></script> <script src="https://unpkg.com/tippy.js@6/dist/tippy-bundle.umd.js"></script> <!-- Production --> <script src="https://unpkg.com/@popperjs/core@2"></script> <script src="https://unpkg.com/tippy.js@6"></script>
Place them at the very bottom of the
<body>, ensuring they are placed before
your own scripts. The version numbers after
@ are important, make sure they
don't get removed.
The CSS automatically gets injected into
<head>with the CDN (
tippy-bundle). With CSP enabled, you may need to separately link
Using React? Use the official component package which integrates well with React, allowing you to use Tippy declaratively.
#Optional extra imports
For brevity, this documentation shows imports via a module bundler in Node. If
you're using the CDN, you'll be using
<link> tags instead.
This optional extra import in the documentation:
Is equivalent to this using a CDN in the browser:
<link rel="stylesheet" href="https://unpkg.com/tippy.js@6/animations/scale.css" />