{% extends "templates/sink.nunjucks" %} {% block body %}

Tooltips Sink

The pink underline on the tooltip text in the paragraph is just for illustration purposes on this sink page. It is NOT part of the component. Any element can trigger a tooltip.

The tooltip is absolutely positioned relative to its trigger. This removes a need for Javascript to calculate absolute positions every time the window is resized. At this time there is no edge-detection for tooltips. They will appear offscreen if the trigger is too close to the viewport edge.

{% set tooltip_content %} Tool tip text goes here and here and some text here and maybe just maybe here. Link to google {% endset %}

Default Tooltip, top center

This is a paragraph of text and {% call luci.tooltip(content=tooltip_content) %}this word{% endcall %} is the tooltip trigger.

This is a paragraph of text and {% call luci.tooltip(content="short") %}this word{% endcall %} is the tooltip trigger.

Multiple Tooltips in paragraph

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem soluta saepe, {% call luci.tooltip(content="This is the first tooltip") %}tooltip 1 trigger{% endcall %} aliquid corrupti deleniti consectetur est, quaerat impedit mollitia? Incidunt fugit, sequi corrupti. Exercitationem quas doloremque nihil at? Lorem ipsum dolor {% call luci.tooltip(content="This is the second tooltip") %}tooltip 2 trigger{% endcall %}sit amet, consectetur adipisicing elit. Dignissimos et saepe eum iste assumenda maiores quae magnam ad aliquam laudantium veniam aliquid incidunt omnis aspernatur, sapiente doloribus sint esse corporis.

Button as trigger

{% call luci.tooltip(content="This is a tooltip on a button", element="div") %}{{ luci.button() }}{% endcall %}

Text Input as trigger

{% call luci.tooltip(content="This is a tooltip on a form input") %}{{ luci.form_input() }}{% endcall %}

Icon as trigger

{% call luci.tooltip(content="This is a tooltip on an icon") %}{{ luci.icon(name="help") }}{% endcall %}

Icon as trigger, tooltip only appears on click

Tooltips appear on hover AND on click (to support touch screens) by default. The modifier class luci-tooltip--hidden-on-hover removes the "appear on hover" behavior and only allows the tooltip to be shown on click.

{% call luci.tooltip(class="luci-tooltip--hidden-on-hover", content="This is a tooltip on an icon") %}{{ luci.icon(name="help") }}{% endcall %}

Bottom Center

This is a paragraph of text and {% call luci.tooltip(class="luci-tooltip--bottom-center", content=tooltip_content) %}this word{% endcall %} is the tooltip trigger.

This is a paragraph of text and {% call luci.tooltip(class="luci-tooltip--bottom-center", content="short") %}this word{% endcall %} is the tooltip trigger.

Position Examples

The tooltip has 12 different position modifier classes.

{% call luci.tooltip(class="luci-tooltip--visible", content="Top Center (Default)") %}top center{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--top-left", content="Top Left") %}top left longer trigger to show tail position{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--top-right", content="Top Right") %}top right longer trigger to show tail position{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--bottom-center", content="Bottom Center") %}bottom center{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--bottom-left", content="Bottom Left") %}bottom left{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--bottom-right", content="Bottom Right") %}bottom right{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--left-top", content="Left Top Really long to make this wrap when it hits the max width") %}left top{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--left-center", content="Left Center Really long to make this wrap when it hits the max width") %}left center{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--left-bottom", content="Left Bottom Really long to make this wrap when it hits the max width") %}left bottom{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--right-top", content="Left Top Really long to make this wrap when it hits the max width") %}right top{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--right-center", content="Left Center Really long to make this wrap when it hits the max width") %}right center{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--right-bottom", content="Left Bottom Really long to make this wrap when it hits the max width") %}right bottom{% endcall %}

Additional Static Examples

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--right-center", content="Right Center Really long to make this wrap when it hits the max width") %}right center{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--left-center", content="Left Center") %}tall trigger to
test vertical
centering
{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--right-center", content="Right Center") %}tall trigger to
test vertical
centering
{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--right-top", content="a") %}a{% endcall %}

{% call luci.tooltip(class="luci-tooltip--visible luci-tooltip--bottom-right", content="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos voluptate, doloremque non quaerat hic provident sequi, perspiciatis ratione sint nostrum aspernatur error, dolorum iure alias cupiditate sit, enim rem? Inventore.") %}Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nesciunt aut optio delectus voluptatibus omnis, nam minima vel. Nisi, atque sit! Error obcaecati cumque inventore rem commodi eligendi autem praesentium odit.{% endcall %}



{% endblock body %}