A tooltip is a floating, non-actionable information that appears when a user hovers over, focuses, or long-press on an element. You can use a tooltip to add information about the parent element. For the icon button it is used to describe the context or action.
Configurator
<div style="width:100%;min-height:180px;display:flex;align-items:center;justify-content:center"><oc-icon-button-v3 variant="secondary" size="100" icon="copy" oc-aria-label="Kopieren" data-oc-tooltip-v2=""></oc-icon-button-v3></div>Usage
Anatomy
HTML
<oc-icon-button-v3 variant="secondary" size="100" icon="share" oc-aria-label="Teilen"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="tooltip" visible trigger="none" close-on="none" position="bottom">Teilen</oc-popover-v1></div>
Behavior
Interaction
The tooltip appears on hover, long-press or focus (tab) on the parent element. The tooltip disappears after navigating away from the parent element.
Hover, long-press or focus (Tab) the parent element
The tooltip shows below it
Navigate away and it disappears
HTML
<p class="demo-label" style="text-align:center">Hover, long-press or focus (Tab) the parent element</p><oc-icon-button-v3 variant="secondary" size="100" icon="share" oc-aria-label="Teilen" data-oc-tooltip-v2></oc-icon-button-v3><p class="demo-label" style="text-align:center">The tooltip shows below it</p><div class="group" style="will-change:transform;align-items:center;min-height:80px;align-self:stretch"><oc-icon-button-v3 variant="secondary" size="100" icon="share" oc-aria-label="Teilen"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="tooltip" visible trigger="none" close-on="none" position="bottom">Teilen</oc-popover-v1></div><p class="demo-label" style="text-align:center">Navigate away and it disappears</p><oc-icon-button-v3 variant="transparent" size="100" icon="share" oc-aria-label="Teilen"></oc-icon-button-v3></div>Fitting
The tooltip uses fit-content. If there is not enough space, the content breaks and fills the viewport with 8px distance to the sides. The maximum width of the tooltip is 432px.
fit-content
Breaks at the maximum width, 8px from the viewport edge
HTML
<p class="demo-label" style="align-self:stretch;text-align:center">fit-content</p><oc-icon-button-v3 variant="secondary" size="100" icon="copy" oc-aria-label="Kopieren"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="tooltip" visible trigger="none" close-on="none" position="bottom">Kopieren</oc-popover-v1></div>
<p class="demo-label" style="align-self:stretch;text-align:center">Breaks at the maximum width, 8px from the viewport edge</p><oc-icon-button-v3 variant="secondary" size="100" icon="copy" oc-aria-label="Kopieren"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="tooltip" visible trigger="none" close-on="none" position="bottom">Dies ist ein längerer Hinweis: Er bricht um, sobald er die maximale Breite erreicht, und hält immer 8px Abstand zum Rand.</oc-popover-v1></div>
Placement
By default, the tooltip is positioned centered below the parent element but you can also place it above. In general the position depends on the available space, so it can be aligned to the left, center or right and top or bottom. The tooltip has a spacing of 4px to the parent element.
Bottom (default)
Top
HTML
<p class="demo-label" style="align-self:stretch;text-align:center">Bottom (default)</p><oc-icon-button-v3 variant="secondary" size="100" icon="share" oc-aria-label="Teilen"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="tooltip" visible trigger="none" close-on="none" position="bottom">Teilen</oc-popover-v1></div>
<p class="demo-label" style="align-self:stretch;text-align:center">Top</p><oc-icon-button-v3 variant="secondary" size="100" icon="share" oc-aria-label="Teilen"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="tooltip" visible trigger="none" close-on="none" position="top">Teilen</oc-popover-v1></div>
Left
Center
Right
HTML
<p class="demo-label" style="align-self:stretch;text-align:center">Left</p><oc-icon-button-v3 variant="secondary" size="100" icon="copy" oc-aria-label="Link zum Artikel kopieren"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="tooltip" visible trigger="none" close-on="none" position="bottom">Link zum Artikel kopieren</oc-popover-v1></div>
<p class="demo-label" style="align-self:stretch;text-align:center">Center</p><oc-icon-button-v3 variant="secondary" size="100" icon="copy" oc-aria-label="Link zum Artikel kopieren"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="tooltip" visible trigger="none" close-on="none" position="bottom">Link zum Artikel kopieren</oc-popover-v1></div>
<p class="demo-label" style="align-self:stretch;text-align:center">Right</p><oc-icon-button-v3 variant="secondary" size="100" icon="copy" oc-aria-label="Link zum Artikel kopieren"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="tooltip" visible trigger="none" close-on="none" position="bottom">Link zum Artikel kopieren</oc-popover-v1></div>
Tooltips are placed above the canvas and frame (level 2). Therefore the tooltip uses a shadow200. For further information refer to the elevationdocumentation.
Tooltip vs. toggletip
Tooltips provide quick and temporary help or explanations, while toggletips provide more detailed information and must be actively closed. For example, you can use a tooltip to describe the context of an icon button. On the other hand, you can use a toggletip to introduce a new feature.
Tooltip
Toggletip
Neu: AR-Ansicht
Platziere dieses Produkt virtuell in deinem Raum, direkt über die Kamera deines Geräts.
HTML
<p class="demo-label" style="align-self:stretch;text-align:center">Tooltip</p><oc-icon-button-v3 variant="secondary" size="100" icon="augmented-reality" oc-aria-label="AR-Ansicht"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="tooltip" visible trigger="none" close-on="none" position="bottom">AR-Ansicht</oc-popover-v1></div>
<p class="demo-label" style="align-self:stretch;text-align:center">Toggletip</p><oc-icon-button-v3 variant="secondary" size="100" icon="augmented-reality" oc-aria-label="AR-Ansicht"></oc-icon-button-v3><oc-popover-v1 anchor="previous-sibling" variant="toggletip" close-button visible close-on="none" position="bottom" oc-aria-label="Neu: AR-Ansicht" style="--min-width:min(21rem, calc(100% - 16px))"><div style="display:flex;gap:12px;align-items:flex-start"><oc-icon-v1 type="question-hint" style="flex:none"></oc-icon-v1><div class="demo-stack gap-8"><p class="oc-headline-100" style="color:inherit">Neu: AR-Ansicht</p><p>Platziere dieses Produkt virtuell in deinem Raum, direkt über die Kamera deines Geräts.</p><div class="demo-row" style="gap:16px"><oc-link-v2 variant="inverted" as-button>Mehr erfahren</oc-link-v2><oc-link-v2 variant="inverted-bold" as-button>Ausprobieren</oc-link-v2></div></div></div></oc-popover-v1></div>
Content Guidelines
Accessibility
Related components
Implementation
Live demo
Neu im Sortiment
Over-Ear-Kopfhörer mit Noise Cancelling, Schwarz
279,00 €
inkl. MwSt., versandkostenfrei
Lieferung morgen, wenn du bis 14 Uhr bestellst
HTML
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr));gap:32px;align-items:center">
<div style="position:relative">
<img src="/previews/imagery/samples/otto-product-still/product-headphones.webp" alt="Kopfhörer Studio Pro in Schwarz" style="display:block;width:100%;aspect-ratio:1;object-fit:cover;border-radius:16px">
<oc-icon-button-v3 variant="secondary-over-color" elevation-level="above" icon="wishlist" oc-aria-label="Merken" data-oc-tooltip-v2></oc-icon-button-v3>
<oc-icon-button-v3 variant="secondary-over-color" elevation-level="above" icon="share" oc-aria-label="Teilen" data-oc-tooltip-v2></oc-icon-button-v3>
<oc-icon-button-v3 variant="secondary-over-color" elevation-level="above" icon="augmented-reality" oc-aria-label="In deinem Raum ansehen" data-oc-tooltip-v2="AR-Ansicht"></oc-icon-button-v3>
<div><p class="oc-copy-75" style="color:#6d6d6d">Neu im Sortiment</p><p class="oc-headline-200">Over-Ear-Kopfhörer mit Noise Cancelling, Schwarz</p></div>
<div><p class="oc-headline-300">279,00 €</p><p class="oc-copy-75" style="color:#6d6d6d">inkl. MwSt., versandkostenfrei</p></div>
<oc-divider-v1></oc-divider-v1>
<div style="display:flex;align-items:center;gap:8px"><oc-icon-v1 type="delivery-24h" style="flex:none"></oc-icon-v1><p class="oc-copy-100">Lieferung morgen, wenn du bis 14 Uhr bestellst</p></div>
<oc-button-v1 variant="primary" icon-type-left="basket">In den Warenkorb</oc-button-v1>
<oc-icon-button-v3 variant="secondary" icon="copy" oc-aria-label="Link zum Artikel kopieren" data-oc-tooltip-v2="Link kopieren"></oc-icon-button-v3>