Snippets Animation

Bootstrap 5 Animated Tooltip

A set of tooltips that pop in with a soft spring animation, shown from the top, right, bottom and left of buttons and from an icon. They also appear on keyboard focus.

Bootstrap 5 No jQuery Dec 2019 2.6K views

<section class="wdw-stage">
  <div class="container" style="max-width:820px">
    <div class="wdw-card overflow-hidden">
      <div class="wdw-aurora px-4 px-md-5 py-4">
        <span class="wdw-eyebrow" style="color:rgba(255,255,255,.8)">Tooltips</span>
        <h1 class="wdw-heading h3 text-white mt-1 mb-0">Animated tooltips</h1>
      </div>
      <div class="p-4 p-md-5">
        <p class="small fw-bold wdw-muted text-uppercase mb-0">Placements</p>
        <div class="row g-3 tip-gap">
          <div class="col-6 col-md-3"><button type="button" class="btn btn-outline-primary w-100 rounded-pill" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-custom-class="wdw-tip" data-bs-title="Shown on top" id="pinnedTip">Top</button></div>
          <div class="col-6 col-md-3"><button type="button" class="btn btn-outline-primary w-100 rounded-pill" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-custom-class="wdw-tip" data-bs-title="Shown on the right">Right</button></div>
          <div class="col-6 col-md-3"><button type="button" class="btn btn-outline-primary w-100 rounded-pill" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-custom-class="wdw-tip" data-bs-title="Shown below">Bottom</button></div>
          <div class="col-6 col-md-3"><button type="button" class="btn btn-outline-primary w-100 rounded-pill" data-bs-toggle="tooltip" data-bs-placement="left" data-bs-custom-class="wdw-tip" data-bs-title="Shown on the left">Left</button></div>
        </div>
        <hr class="my-4">
        <div class="row g-4">
          <div class="col-md-7">
            <p class="small fw-bold wdw-muted text-uppercase">Toolbar with shortcuts</p>
            <div class="d-flex flex-wrap gap-2" role="toolbar" aria-label="Formatting"><button type="button" class="btn btn-outline-secondary tool-btn" data-bs-toggle="tooltip" data-bs-html="true" data-bs-custom-class="wdw-tip wdw-tip-rich" data-bs-title="<span class="tip-t">Bold</span><span class="tip-k"><kbd>Ctrl</kbd><kbd>B</kbd></span>" aria-label="Bold"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z"/></svg></button><button type="button" class="btn btn-outline-secondary tool-btn" data-bs-toggle="tooltip" data-bs-html="true" data-bs-custom-class="wdw-tip wdw-tip-rich" data-bs-title="<span class="tip-t">Italic</span><span class="tip-k"><kbd>Ctrl</kbd><kbd>I</kbd></span>" aria-label="Italic"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19 4h-9M14 20H5M15 4 9 20"/></svg></button><button type="button" class="btn btn-outline-secondary tool-btn" data-bs-toggle="tooltip" data-bs-html="true" data-bs-custom-class="wdw-tip wdw-tip-rich" data-bs-title="<span class="tip-t">Link</span><span class="tip-k"><kbd>Ctrl</kbd><kbd>K</kbd></span>" aria-label="Link"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 14a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1 1M14 10a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1-1"/></svg></button><button type="button" class="btn btn-outline-secondary tool-btn" data-bs-toggle="tooltip" data-bs-html="true" data-bs-custom-class="wdw-tip wdw-tip-rich" data-bs-title="<span class="tip-t">Comment</span><span class="tip-k"><kbd>Ctrl</kbd><kbd>Alt</kbd><kbd>M</kbd></span>" aria-label="Comment"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12a8 8 0 0 1-11.6 7.1L3 20l1-4.6A8 8 0 1 1 21 12z"/></svg></button><button type="button" class="btn btn-outline-secondary tool-btn" data-bs-toggle="tooltip" data-bs-html="true" data-bs-custom-class="wdw-tip wdw-tip-rich" data-bs-title="<span class="tip-t">Share</span><span class="tip-k"><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>S</kbd></span>" aria-label="Share"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="m8.6 13.5 6.8 4M15.4 6.5l-6.8 4"/></svg></button></div>
          </div>
          <div class="col-md-5">
            <p class="small fw-bold wdw-muted text-uppercase">Avatar with name</p>
            <div class="d-flex"><button type="button" class="avatar-btn" data-bs-toggle="tooltip" data-bs-html="true" data-bs-custom-class="wdw-tip wdw-tip-rich" data-bs-title="<span class="tip-t">Maya Ortiz</span><span class="tip-s">Product designer</span>" aria-label="Maya Ortiz, Product designer">MO</button><button type="button" class="avatar-btn" data-bs-toggle="tooltip" data-bs-html="true" data-bs-custom-class="wdw-tip wdw-tip-rich" data-bs-title="<span class="tip-t">Tom Reyes</span><span class="tip-s">Frontend developer</span>" aria-label="Tom Reyes, Frontend developer">TR</button><button type="button" class="avatar-btn" data-bs-toggle="tooltip" data-bs-html="true" data-bs-custom-class="wdw-tip wdw-tip-rich" data-bs-title="<span class="tip-t">Priya Nair</span><span class="tip-s">Data analyst</span>" aria-label="Priya Nair, Data analyst">PN</button><button type="button" class="avatar-btn" data-bs-toggle="tooltip" data-bs-html="true" data-bs-custom-class="wdw-tip wdw-tip-rich" data-bs-title="<span class="tip-t">Daniel Cho</span><span class="tip-s">Customer success</span>" aria-label="Daniel Cho, Customer success">DC</button></div>
          </div>
        </div>
        <p class="mb-0 mt-4 wdw-muted small">Hover, focus or tap any control. Keyboard focus shows the tooltip too, so nothing is hover-only.</p>
      </div>
    </div>
  </div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.