Snippets Tooltip

Bootstrap 5 Tooltip with Image and Content

Inline text links that reveal a rich preview card with a photo and short description on hover, keyboard focus or tap.

Bootstrap 5 No jQuery May 2020 15K views

<section class="tip-section wdw-stage">
  <div class="container">
    <article class="card wdw-card border-0 tip-card mx-auto overflow-hidden">
      <img class="tip-hero" src="https://images.unsplash.com/photo-1555881400-74d7acaacd8b?auto=format&fit=crop&w=1400&q=70" alt="Colourful riverside houses and boats on a sunny day" width="1400" height="560">
      <div class="card-body p-4 p-md-5">
        <span class="badge rounded-pill bg-primary-subtle text-primary-emphasis mb-3">Field notes</span>
        <h1 class="h3 fw-bold text-body-emphasis mb-3">A weekend guide to Lisbon</h1>
        <p class="tip-copy text-body-secondary mb-0">Start with a pastry at <button type="button" class="tip-trigger fw-semibold" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-html="true" data-tip="1">Pastéis de Belém</button>, ride the old tram up to <button type="button" class="tip-trigger fw-semibold" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-html="true" data-tip="2">Alfama</button> and finish the day on the water at <button type="button" class="tip-trigger fw-semibold" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-html="true" data-tip="3">LX Factory</button>.</p>
        <p class="small text-body-secondary mt-4 mb-0">Hover, focus or tap an underlined place name for a preview. Press Esc to close.</p>
      </div>
    </article>
  </div>

  <template id="tip-1"><img class="tip-img" src="https://images.unsplash.com/photo-1555507036-ab1f4038808a?auto=format&fit=crop&w=600&q=70" alt="Fresh pastries dusted with sugar" width="260" height="140"><div class="tip-body"><strong>Pastéis de Belém</strong><span>Custard tarts baked since 1837. Go early to skip the queue.</span></div></template>
  <template id="tip-2"><img class="tip-img" src="https://images.unsplash.com/photo-1536663815808-535e2280d2c2?auto=format&fit=crop&w=600&q=70" alt="Tram climbing a narrow street" width="260" height="140"><div class="tip-body"><strong>Alfama</strong><span>The oldest quarter, all steep lanes and fado at night.</span></div></template>
  <template id="tip-3"><img class="tip-img" src="https://images.unsplash.com/photo-1513735492246-483525079686?auto=format&fit=crop&w=600&q=70" alt="Waterfront at sunset" width="260" height="140"><div class="tip-body"><strong>LX Factory</strong><span>Former mill turned studios, bookshops and rooftop bars.</span></div></template>
</section>

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

Free to use in personal and commercial projects under the MIT license.