How To Use Your Tooltip Classes

Default

data-tooltip='Tooltip content'

The default tooltip, requires nothing more than adding data-tooltip="content", shifts to the bottom by 8px showing in box format up to 300px wide. The content can include special entities like unicode characters but not html content directly.

With Arrow

class='tooltip-arrow'

By default tooltips do not include arrows, you can add them by simply adding to the class selector. class="tooltip-arrow" An arrow will be added to the appropriate position based on tooltip direction.

Position

class='tooltip-[direction]'

Positioning your tooltips is a breeze, by adding a specific class you can style your tooltips to popout from any of 8 directions.

Color Modifiers

class='tooltip-[colortype]'
info success warning error
primary secondary tertiary

You can color your tooltips by using the default color classes of stats and primary/secondary/tertiary.

Tooltip Sizing

class='tooltip-[size]'

Small Medium Large Fit

There are four size choices to choose from and by default all tooltips are set to large. Size small is up to 80px, Size medium is up to 150px, and Size Large is up to 300px. Size fit matches the size of the element they are attached to. The tooltip treats this as a maximum size, and by default will only take up as much size as is needed unless it needs to wrap to a second line.

Extra Modifiers

class='tooltip-[modifier]'

There are special cases where you might want to hide a tooltip via code, you can do so by adding and removing class="tooltip-hidden" You might also want a tooltip to always show, regardless of hover. For that scenario you would use class="tooltip-active" Finally, using a fixed-width tooltip might suit your fancy, but this style is generally used with size and text styles.

Hide Tooltip

class='tooltip-hidden-[where]'
Class
Mobile
Tablet
Desktop
Size
tooltip-hidden-mobile
hidden
visible
visible
width up to 768px
tooltip-hidden-tablet
visible
hidden
visible
between 769px and 1023px width
tooltip-hidden-desktop
visible
visible
hidden
width greater than 1024px

Hiding tooltips at certain screen sizes can be useful for responsive designs. For example, you might want to hide tooltips on mobile devices to avoid them taking up too much space on smaller screens, or tablet because they are clunky with touch, or even desktop.

How To Use Your Tooltip Styles

With Advanced Delay Modifiers

style='--tooltip-[show/hide]-delay: [value];'
Show Delay
Hide Delay

By default tooltips have a show delay of 300ms when you hover into the element and a hide delay of 200ms after you hover away before they dissappear. This value is completely customizable by adding a style property to your element. style="--tooltip-show-delay: 1000ms;" would make the tooltip not show up until 1000ms has passed. style="--tooltip-hide-delay: 1000ms;" would make the tooltip linger after you hover away from the element for 1000ms. Any valid delay value will work here (1s, 500ms, etc).

With Other Style Modifiers

Z-Index Width
Border Radius Custom Color

With added styles tooltips are ridiculously customizable, from setting a custom Z-Index, custom width, or even custom colors you can create special classes that encompass styles.

Custom Classes

class='tooltip-chip'

With an abundance of styles you could make custom classes for often or repeatable styles like: Test


.tooltip-chip {
    --tooltip-show-delay: 1000ms;
    --tooltip-post-delay: 0ms;
    --tooltip-border-radius: 12px;
    --tooltip-background-color: blue;
    --tooltip-foreground-color: red;
    --tooltip-distance: 4px;
}