Tooltips

A tooltip is a brief, informative message that appears when a user interacts with an element in a graphical user interface (GUI). Tooltips are usually initiated in one of two ways: through a mouse-hover gesture or through a keyboard-hover gesture. They are meant to clarify or help using the content they hover over, not to add additional conten

  • Don’t use tooltips for information that is vital to task completion.
  • Provide brief and helpful content inside the tooltip.
  • Support both mouse and keyboard hover.
  • Use tooltip arrows when multiple elements are nearby.
  • Use tooltips consistently throughout your site.
  • Provide tooltips for unlabeled icons.
  • Ensure tooltips have moderate contrast against the background.
  • Position tooltips so they don’t block related content.

Documentation and examples for adding custom Bootstrap tooltips with CSS and JavaScript using CSS3 for animations and data-attributes for local title storage.: Bootstrap Tooltips

Hover over the buttons below to see their tooltips.

Tooltip with HTML


<button type="button" class="btn btn-primary mb-1" data-toggle="tooltip" data-placement="top" title="Tooltip on top"> Tooltip on top </button> <button type="button" class="btn btn-primary mb-1" data-toggle="tooltip" data-placement="right" title="Tooltip on right"> Tooltip on right </button> <button type="button" class="btn btn-primary mb-1" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom"> Tooltip on bottom </button> <button type="button" class="btn btn-primary mb-1" data-toggle="tooltip" data-placement="left" title="Tooltip on left"> Tooltip on left </button> <div class="mb-4"></div> <a href="#" role="button" class="btn btn-primary mb-1" data-toggle="tooltip" data-html="true" title="&lt;em&gt;Tooltip&lt;/em&gt; &lt;u&gt;with&lt;/u&gt; &lt;b&gt;HTML&lt;/b&gt;"> Tooltip with HTML </a>

Popovers

Show important notifications and additional information in popovers. This UI pattern has the advantage of providing a lightweight and straightforward way of viewing additional information or taking a particular action, but they do so without pulling the user out of their current activity.

Popovers are meant to give related additional content. While tooltips are meant to convey the intent of an element, Popovers may be more verbose, and can include a header and many lines of text in the body.

Documentation and examples for adding custom Bootstrap tooltips with CSS and JavaScript using CSS3 for animations and data-attributes for local title storage.: Bootstrap Popovers

Four options are available: top, right, bottom, and left aligned.

Click to toggle popover


<a role="button" href="#" class="btn btn-primary" data-toggle="popover" data-trigger="focus" data-placement="top" title="Popover title" data-content="Here's some engaging content the elaborates on existing information.">Click to toggle popover</a>