# Tooltip [component-header:sl-tooltip] Tooltips display additional information based on a specific action. A tooltip's target is its _first child element_, so you should only wrap one element inside of the tooltip. If you need the tooltip to show up for multiple elements, nest them inside a container first. Tooltips use `display: contents` so they won't interfere with how elements are positioned in a flex or grid layout. ```html preview Hover Me ``` ## Examples ### Placement Use the `placement` attribute to set the preferred placement of the tooltip. ```html preview
``` ### Click Trigger Set the `trigger` attribute to `click` to toggle the tooltip on click instead of hover. ```html preview Click to Toggle ``` ### Manual Trigger Tooltips can be controller programmatically by setting the `trigger` attribute to `manual`. Use the `open` attribute to control when the tooltip is shown. ```html preview Toggle Manually ``` ### Remove Arrows You can control the size of tooltip arrows by overriding the `--sl-tooltip-arrow-size` design token. ```html preview
Above Below
``` To override it globally, set it in a root block in your stylesheet after the Shoelace stylesheet is loaded. ```css :root { --sl-tooltip-arrow-size: 0; } ``` ### HTML in Tooltips Use the `content` slot to create tooltips with HTML content. Tooltips are designed only for text and presentational elements. Avoid placing interactive content, such as buttons, links, and form controls, in a tooltip. ```html preview
I'm not just a tooltip, I'm a tooltip with HTML!
Hover me
``` ### Hoisting Tooltips will be clipped if they're inside a container that has `overflow: auto|hidden|scroll`. The `hoist` attribute forces the tooltip to use a fixed positioning strategy, allowing it to break out of the container. In this case, the tooltip will be positioned relative to its containing block, which is usually the viewport unless an ancestor uses a `transform`, `perspective`, or `filter`. [Refer to this page](https://developer.mozilla.org/en-US/docs/Web/CSS/position#fixed) for more details. ```html preview
No Hoist Hoist
``` [component-metadata:sl-tooltip]