Tooltip
Reveal a short description on hover or focus.
Usage
Keep essential information in the page and use a tooltip for a short supplementary description.
Accessibility
Show on hover and keyboard focus; Escape dismisses it without changing focus.
| Property | Type | Default |
|---|---|---|
| content | ReactNode | Required |
| children | ReactElement | Required |
<Tooltip content="Open the original reference"><Button>Reference</Button></Tooltip>Static HTML tooltip
Load the package stylesheet. In a package-aware build, import the controller, attach it to the native trigger and hidden panel, and call destroy before removing or replacing the elements.
<a id="reference" href="/guide">Guide</a>
<span id="reference-tip" class="om-tooltip" role="tooltip" hidden>
Open the original reference
</span>
<script type="module">
import { mountTooltip } from '@oddmash/ui/tooltip-controller';
import '@oddmash/ui/styles.css';
const trigger = document.getElementById('reference');
const panel = document.getElementById('reference-tip');
const controller = mountTooltip(trigger, panel);
const dispose = () => controller.destroy();
</script>