--- template: overrides/main.html icon: material/comment-processing-outline --- # Tooltips Material for MkDocs makes it trivial to add tooltips to links, abbreviations and all other elements, which allows for implementing glossary-like functionality, as well as small hints that are shown when the user hovers or focuses an element. ## Configuration This configuration enables support for tooltips and abbreviations and allows to build a simple glossary, sourcing definitions from a central location. Add the following lines to `mkdocs.yml`: ``` yaml markdown_extensions: - abbr - attr_list - pymdownx.snippets ``` See additional configuration options: - [Abbreviations] - [Attribute Lists] - [Snippets] [Abbreviations]: ../setup/extensions/python-markdown.md#abbreviations [Attribute Lists]: ../setup/extensions/python-markdown.md#attribute-lists [Snippets]: ../setup/extensions/python-markdown-extensions.md#snippets ### Improved tooltips :material-alert-decagram:{ .mdx-pulse title="Added on May 8, 2022" } [:octicons-heart-fill-24:{ .mdx-heart } Sponsors only][Insiders]{ .mdx-insiders } · [:octicons-tag-24: insiders-4.15.0][Insiders] · :octicons-beaker-24: Experimental When improved tooltips are enabled, Material for MkDocs replaces the browser's rendering logic for `title` attribute with beautiful little tooltips. Add the following lines to `mkdocs.yml`: ``` yaml theme: features: - content.tooltips ``` Now, tooltips will be rendered for the following elements: - __Content__ – elements with a `title`, permalinks and copy-to-clipboard button - __Header__ – home button, header title, color palette switch and repository link - __Navigation__ – links that are shortened with ellipsis, i.e. `...` [Insiders]: ../insiders/index.md ## Usage ### Adding tooltips The [Markdown syntax] allows to specify a `title` for each link, which will render as a beautiful tooltip when [improved tooltips] are enabled. Add a tooltip to a link with the following lines: ``` markdown title="Link with tooltip, inline syntax" [Hover me](https://example.com "I'm a tooltip!") ```