/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
docs/pages/ui/components/tooltip.mdx
36 строк
2 KB
Paweł Kuna
Generate SCSS and JS docs snippets from source markers (#2798)
05 авг 2026, 19:44
Не верифицирован
05 авг 2026, 19:44
9c4dc73
Код
Авторство
О чём код?
--- title: Tooltip summary: A tooltip is a text label that appears when a user hovers over an interface element. It explains unclear elements and guides users when they need help. When used properly, it can significantly enhance user experience and add value to your website or software. description: Guide users with an informative tooltip. layout: '@layouts/DocsMdxLayout.astro' --- import Example from '@components/Example.astro'; import CodeDocs from '@components/CodeDocs.astro'; ## Default markup Use the default markup to create tooltips that will help users understand particular elements of your interface. You can decide where the text label is to be displayed - at the top, bottom or on either side of the element. <Example> <button type="button" class="btn" data-bs-toggle="tooltip" data-bs-placement="top" title="Tooltip on top" > Tooltip on top </button> <button type="button" class="btn" data-bs-toggle="tooltip" data-bs-placement="right" title="Tooltip on right" > Tooltip on right </button> <button type="button" class="btn" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Tooltip on bottom" > Tooltip on bottom </button> <button type="button" class="btn" data-bs-toggle="tooltip" data-bs-placement="left" title="Tooltip on left" > Tooltip on left </button> </Example> ## Tooltip with HTML If the default tooltip is not enough, you can add the option to use HTML code in the text to highlight particular bits of information and make the content more attractive. <Example> <button type="button" class="btn" data-bs-toggle="tooltip" data-bs-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>" > Tooltip with HTML </button> </Example> ## JavaScript Tabler automatically initializes all elements with `data-bs-toggle="tooltip"` on page load. This is the code that runs: <CodeDocs name="tooltip-init" file="core/js/src/tooltip.ts" /> ## SCSS variables Use these SCSS variables to customize tooltips. The default values are: <CodeDocs name="tooltip-variables" file="core/scss/_variables.scss" />