From 13aef35043788b4150a7bf87d8448a30b3891a37 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 24 Jun 2026 15:30:08 -0700 Subject: [PATCH] Docs: document delegated tooltips via the selector option Add an example initializing one Tooltip on a parent with the selector option to cover many (and dynamically-added) triggers. Fixes #41020. --- site/src/content/docs/components/tooltip.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/site/src/content/docs/components/tooltip.mdx b/site/src/content/docs/components/tooltip.mdx index 2a5cc65d72..33f0e0d562 100644 --- a/site/src/content/docs/components/tooltip.mdx +++ b/site/src/content/docs/components/tooltip.mdx @@ -171,6 +171,16 @@ const tooltip = new bootstrap.Tooltip('#example', { +### Delegated tooltips + +To enable tooltips on many triggers at once—including elements added to the DOM later—initialize a single instance on a parent element and pass the [`selector` option](#options). Any matching descendant gets a tooltip without re-initializing: + +```js +const tooltip = new bootstrap.Tooltip(document.body, { + selector: '[data-bs-toggle="tooltip"]' +}) +``` + ### Via data attributes -- 2.47.3