---json { "canonical": ":tooltip", "description": "A Tooltip displays informative text when users hover over, focus on, or tap an element.", "low_quality_page": "false", "page_id": "utozdh69xx3mvdhhrq31k" } --- ====== ComboStrap UI - Tooltip ====== ===== About ===== A ''Tooltip'' displays informative text when users hover over, focus on, or tap an element. {{:docs:content:tooltip_illustration.png|}} With the tooltip component, you can attach any tooltip to any component. ===== Example ===== ==== A link with a custom tooltip ==== Because a link should be written on one line, you need to inline the tooltip markup. Example: * Markup [[#|A tooltipA link with a tooltip on the right]] * Output: \\ \\ \\ By default, when hovering over [[docs:content:link|a link]], you get already the default HTML tooltip with the page [[docs:page:description|description]] as content. {{:docs:content:link_title_tooltip.png|}} ==== A link with the preview tooltip ==== A [[docs:content:link?preview|link]] can get a automatic tooltip via the [[docs:content:link?preview#preview|link preview attribute]]. * Markup [[?preview|A link with a tooltip]] * Output: ==== Button ==== Adding a tooltip to a [[docs:content:button?preview|button]]. Example: * Markup === Tooltip Heading === A tooltip text A button with a tooltip on the top * Output: ==== Text ==== You can also add a tooltip on words. For instance, with the [[docs:content:itext?preview|itext component]] * Markup A tooltip on words can also be addedTooltip on words * Output: ==== Icon ==== You can also add a tooltip on a [[docs:content:icon?preview|icon]]. * Markup === Icon tooltip === A tooltip on a icon can also be added * Output: ==== Image ==== Adding a tooltip on a [[docs:content:image?preview|image]] is not directly supported but if you see your image as text and wrap it up inside a [[docs:content:itext?preview|itext]], you get the same effect. Example: * Markup === Image tooltip === A surfer at the beach {{:docs:block:stock_image_surfer_in_the_see.png?200|}} * Output: To see the tooltip immediately when hovering on the image the [[docs:styling:class|class]] ''d-inline-block'' on the ''itext'' component is mandatory. The ''itext'' component takes then the same size than the image) ===== Syntax ===== A ''tooltip'' is a [[docs:component?preview|UI component]] that adds a tooltip to its direct parent. The tooltip content where: * ''position'' is one of ''top'' (Default),''right'',''bottom'', ''left'' * the tooltip content can be any markup (heading, image, ..)