← All Components
<mth-tooltip>
Non-focus-stealing tooltip with progressive interestfor detection, hover/focus/long-press intent fallback, and adopted CSSStyleSheet positioning.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-tooltip>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/tooltip"></script>
<mth-tooltip placement="top" delay="250">Example</mth-tooltip>import '@methane-ui/ui/tooltip';
import '@methane-ui/react';
export function Example() {
return <mth-tooltip placement="top" delay="250">Example</mth-tooltip>;
}<script setup lang="ts">
import '@methane-ui/ui/tooltip';
</script>
<template>
<mth-tooltip placement="top" delay="250">Example</mth-tooltip>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/tooltip';
import { MthTooltipDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthTooltipDirective],
template: `<mth-tooltip placement="top" delay="250">Example</mth-tooltip>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/tooltip';
import MthTooltip from '@methane-ui/svelte/MthTooltip.svelte';
</script>
<MthTooltip placement="top" delay="250">Example</MthTooltip>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
open | open | boolean | false | Controls open visibility of the tooltip. |
content | content | string | "" | Plain-text tooltip message when slot="content" is not provided. |
placement | placement | string | "top" | Preferred placement relative to the trigger. |
delay | delay | number | 250 | Intent show delay in milliseconds. |
offset | offset | number | 8 | Pixel distance between trigger and tooltip surface. |
disabled | disabled | boolean | false | Prevents the tooltip from opening on user intent. |
forceFallback | force-fallback | boolean | false | Forces JS positioning and non-top-layer fallback mode. |
anchor | — | Element | { getBoundingClientRect(): DOMRect } | DOMRect | null | null | Optional explicit Element, VirtualAnchor, or DOMRect anchor target. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-open | void | Cancelable event fired before showing the tooltip. |
mth-after-open | void | Fired once tooltip becomes visible. |
mth-close | { reason: string } | Cancelable event fired before hiding the tooltip. |
mth-after-close | { reason: string } | Fired once tooltip is hidden. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Escape | both | open | dismisses tooltip without moving focus |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 1 APG keyboard transitions across LTR/RTL. | mth-tooltip.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(open), :state(disabled). | Conformance suite |
| i18n | Routes 1 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |