Skip to content

All Options

Below is a table of all the options you can supply.

OptionTypeDefaultDescription
a11ybooleantrueShort for accessibility - ensures the reference element can receive focus so the tooltip can be activated by keyboard navigation by adding tabindex="0" to the reference element.
animateFillbooleantrueDetermines if the background fill color of the tippy should be animated. Disabled if arrow: true.
allowHTMLbooleantrueDetermines if the tippy can have HTML content rendered inside of it. Make sure you are sanitizing any user data if rendering HTML to prevent XSS attacks.
animationstring"shift-away"The type of transition animation. Possible values: "shift-away", "shift-toward", "fade", "scale", "perspective"
appendTostring, Element, Functiondocument.bodyThe element to append the tippy to. Use "parent" to append it to the reference element's parent node. You can also define a function that takes the reference element as an argument and returns an element.
ariastring"describedby"The aria-* attribute applied to the reference element. Use either "describedby" or "labelledby". Use null to prevent the attribute from being added (recommended for interactive tippys).
arrowbooleanfalseDetermines if an arrow should be added to the tippy pointing toward the reference element.
arrowTypestring"sharp"Determines the arrow type. Possible values: "sharp", "round"
boundarystring, HTMLElement"scrollParent"The boundary that Popper.js' preventOverflow modifier adheres to. Possible values: "scrollParent", "window", "viewport", or an HTMLElement.
contentstring, Element, Function""The content of the tippy. Along with a string or element, you can use a function that receives the reference element as an argument and returns some content.
delaynumber, [show, hide][0, 20]Delay in ms once a trigger event is fired before a tippy shows or hides. Specifying a number means both the show and hide delays are the same. Use null in the array to use the default value.
durationnumber, [show, hide][275, 250]Duration of the CSS transition animation in ms. Specifying a number means both the show and hide delays are the same. Use null in the array to use the default value.
distancenumber10How far in pixels the tippy element is from the reference element. Only applies to a single axis and not to the parent popper element, see the offset option.
flipbooleantrueDetermines if the tippy flips so that it is placed within the viewport as best it can be if there is not enough room.
flipBehaviorstring, string[]"flip"Determines the order of flipping, i.e. which placements to prefer if a certain placement cannot be used. Use an array such as ["bottom", "left"] to prefer the "left" placement if "bottom" is unavailable, instead of "top".
flipOnUpdatebooleanfalseDetermines if the tippy should flip when necessary if its position updates while showing (for example, while scrolling, resize, or if the size of the tooltip changed).
followCursorboolean, stringfalseDetermines if the tippy follows the user's mouse cursor. Use the strings "vertical" or "horizontal" to only follow the cursor on a single axis. Use "initial" to place the tippy at the initial cursor position upon show, but prevent following it. On touch devices, only "initial" places it at the touch position - the other values will position it normally.
hideOnClickboolean, stringtrueDetermines if the tippy should hide if a click event was fired outside of it (i.e. clicking on the reference element or the body of the page). For click-triggered tippys, using false will prevent the tippy from ever hiding once it is showing. To prevent clicks outside of the tippy from hiding it but still allow it to be toggled, use the string "toggle".
ignoreAttributesbooleanfalseDetermines if data-tippy-* attributes on the reference element should be ignored. Increases performance if you enable it.
inertiabooleanfalseDetermines if an inertial slingshot effect is applied to the CSS animation.
interactivebooleanfalseDetermines if the tippy is interactive, i.e. it can be hovered over or clicked without hiding.
interactiveBordernumber2Determines the size in pixels of the invisible border around a tippy which will prevent it from hiding if the cursor left it.
interactiveDebouncenumber0Debounces the internal onMouseMove handler which determines when an interactive tippy should hide.
lazybooleantrueDetermines if the positioning engine (powered by Popper.js) is created lazily. That is, it's only created when necessary upon showing the tippy for the first time. If you need to access the popperInstance synchronously after creation, set this to false. Note that disabling this decreases performance considerably.
maxWidthnumber, string350Determines the maximum width of the tippy. Use a number for pixels, or a string to add units such as rem.
multiplebooleanfalseDetermines if the reference element can have multiple tippys applied to it.
offsetnumber, string0Determines the offset of the tippy element. Unlike distance, it can work on both axes by using a string in the form "x, y", such as "50, 20". Avoid this option if using interactive: true.
onHiddenFunctionnoopLifecycle function invoked when the tippy has fully transitioned out and is unmounted from the DOM. Receives the instance as an argument.
onHideFunctionnoopLifecycle function invoked when the tippy begins to transition out. You can cancel hiding by returning false from this lifecycle. Receives the instance as an argument.
onMountFunctionnoopLifecycle function invoked when the tippy has been mounted to the DOM (called after onShow). Receives the instance as an argument.
onShowFunctionnoopLifecycle function invoked when the tippy begins to transition in. You can cancel showing by returning false from this lifecycle. Receives the instance as an argument.
onShownFunctionnoopLifecycle function invoked when the tippy has fully transitioned in. Receives the instance as an argument.
onTriggerFunctionnoopLifecycle function invoked when the tippy was triggered by a real DOM event (called before onShow). Receives the instance as its first argument and the event object as its second argument.
placementstring"top"Positions the tippy relative to its reference element. Use the suffix -start or -end to shift the tippy to the start or end of the reference element, instead of centering it. For example, "top-start" or "left-end".
popperOptionsobject{}Specify custom Popper.js options. See the Popper.js documentation for more.
rolestring"tooltip"Specifies the role attribute on the tippy element.
showOnInitbooleanfalseDetermines if the tippy will be shown immediately once the instance is initialized.
sizestring"regular"Determines the size of the tippy, defined in CSS. Possible values: "small", "regular", "large"
stickybooleanfalseEnsures the tippy stays stuck to its reference element if it moves around while showing. See the updateDuration option to change the transition duration between position updates.
targetstring""CSS selector string used for event delegation. See Event delegation for more information.
themestring"dark"Themes added as classes (each separated by a space) to the tippy element's classList.
touchbooleantrueDetermines if the tippy displays if the user is currently using touch input.
touchHoldbooleanfalseDetermines trigger behavior on touch devices. Instead of a tap on the reference to show and a tap elsewhere to hide the tippy, the reference must be pressed and held for the tippy to show. Letting go from the screen will hide it. To prevent the mobile context menu from appearing, ensure the element cannot be selected using user-select: none; and/or prevent the default behavior for the contextmenu event.
triggerstring"mouseenter focus"The events (each separated by a space) which cause a tippy to show. Possible values: "mouseenter", "focus", "click", "manual". Use "manual" to only trigger the tippy programmatically.
triggerTargetElementnullWhich element the trigger event listeners are applied to (instead of the reference element).
updateDurationnumber0The transition duration between position updates for the sticky and flipOnUpdate options.
waitFunctionnullA function that, when defined, will wait until you manually invoke the show() method when a tippy is triggered. It takes the tippy instance as the first argument, and the trigger event as the second argument.
zIndexnumber9999Determines the z-index of the tippy.