CSS: tooltip
.instui-tooltip — A CSS hover and focus tooltip bubble, positionable on any side.
Source: tooltip.css
Accessibility
Point the trigger at the bubble with aria-describedby and give the bubble role="tooltip".
Usage
css
@import "@pantoken/components/components.css";
@import "@pantoken/components/tooltip.css";Examples
html
<span class="instui-tooltip" aria-describedby="tt-1">
<span class="instui-icon -icon-info"></span>
<span class="tip" id="tt-1" role="tooltip">Default placement is top</span>
</span>Default placement is top
Structure
text
.instui-tooltip
[class*="-icon-"] (0..1)
.tipflowchart TD
n0[".instui-tooltip"]:::cssdoc-root
n1("[class*="-icon-"]"):::cssdoc-part
n2(".tip"):::cssdoc-part
n0 -.->|0..1| n1
n0 --> n2
classDef cssdoc-root stroke-width:1px;
classDef cssdoc-part stroke-width:1px;
classDef cssdoc-slot stroke-width:1px;
classDef cssdoc-component stroke-width:1px;
Modifiers
| Modifier | Description |
|---|---|
.-icon-* | Render a trigger glyph icon next to the tooltip bubble. |
Parts
| Part | Description |
|---|---|
.tip | The bubble; -placement-* sets its side. |
Tokens consumed
| Token | Type | Value |
|---|---|---|
--instui-border-radius-sm | <length> | 0.25rem |
--instui-color-background-inverse | <color> | light-dark(#334450, #F2F4F5)LightDark |
--instui-color-text-inverse | <color> | light-dark(#ffffff, #1C222B)LightDark |
--instui-component-tooltip-font-family | [ <font-family-name> | <generic-font-family> ]# | Atkinson Hyperlegible Next, "Helvetica Neue", Helvetica, Arial, sans-serif |
--instui-component-tooltip-font-size | <length> | 0.875rem |
--instui-component-tooltip-font-weight | <integer> | 400 |
--instui-component-tooltip-padding | <length> | 0.75rem |
--instui-spacing-space-xs | <length> | 0.25rem |
Related
- popover — The larger, click-triggered anchored surface.
- context-view — A related anchored surface with a pointer.