--- layout: layouts/component.njk title: Tooltip description: A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it. toc: - label: Usage id: usage - label: Examples id: examples children: - label: Default id: example-default - label: Right id: example-right - label: Bottom + Start id: example-bottom-start --- {% from "macros/code_preview.njk" import code_preview %} {% from "macros/code_block.njk" import code_block %} {% set code %}{% endset %} {{ code_preview("button", code) }}

Usage

On any element, set the value of the data-tooltip attribute to the text you want to display in the tooltip. Additionally, you can set:

{% set code %}{% endset %} {{ code_block(code) }}

Examples

Default

{% set code %}{% endset %} {{ code_preview("button", code) }}

Right

{% set code %}{% endset %} {{ code_preview("button", code) }}

Bottom + Start

{% set code %}{% endset %} {{ code_preview("button", code) }}