Components / Overlays

Tooltip

A hover and focus hint that flips to stay on screen; can show a shortcut as keys or rich, non-interactive content.

@ruckc/truss-ui Overlays

Import

import { Tooltip } from '@ruckc/truss-ui';

Playground

placement
delay

API

PropTypeDefaultDescription
text string—Plain-text hint. Optional when `content` or `shortcut` is given.
content snippet Snippet—Rich (non-interactive) content shown in the tip; the tip is `pointer-events: none`, so put no links or buttons in it.
shortcut string—A key combination (`mod+k`, `g h`) shown as keys inside the tip, so it is part of the accessible description. `mod` is ⌘ on Apple platforms and Ctrl elsewhere.
placement 'top' | 'bottom' | 'left' | 'right''top'Preferred side; flips automatically when there is no room.
delay number350ms before showing on hover (focus shows immediately).
children required snippet Snippet—Content, as a Svelte snippet.
/docs/tooltip Truss UI · MIT