Default button tooltip
The default position is `top` and the default tone is `info`.
<CwTooltip value="Refresh the dashboard data">
<CwButton variant="secondary">Refresh</CwButton>
</CwTooltip>Short descriptions that appear on hover and on keyboard focus. The bubble is linked to its
trigger with aria-describedby, stays open while the pointer moves onto it, and
closes with Escape.
<CwTooltip value="Tooltip on top" position="top">
<CwButton variant="secondary">Top</CwButton>
</CwTooltip>Tab to a trigger to show its tooltip, then press Escape to hide it without moving focus.
Hover or focus Vapour pressure deficit to see a tooltip on inline content. Use a focusable element so keyboard users can reach it.
CwTooltip wraps an existing trigger element and shows short, contextual guidance on hover or focus. Keep the copy concise and use it for hints, not large descriptions.
| API | Type | Details |
|---|---|---|
value Required | string | Tooltip text content. |
position Default: | 'top' | 'bottom' | 'left' | 'right' | Placement relative to the trigger. |
tone Default: | CwTone | Tooltip color theme. |
children Required | Snippet | Wrapped trigger content. |
Each snippet is a complete, working example you can paste into a Svelte 5 component.
The default position is `top` and the default tone is `info`.
<CwTooltip value="Refresh the dashboard data">
<CwButton variant="secondary">Refresh</CwButton>
</CwTooltip>Tooltips can also wrap inline text, not just buttons.
<p>
Sensor status:
<CwTooltip value="No device data has arrived in the last 30 minutes." tone="warning" position="right">
<span style="text-decoration:underline dotted;cursor:help">stale</span>
</CwTooltip>
</p>