Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-coachmark>

@methane-ui/ui~9.0 KB brotli (cold + Lit)~2.6 KB marginal

Anchored feature-discovery coachmark popover using OverlayController and PositioningController with optional beacon and step counter.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-coachmark> (@methane-ui/ui)
Inspect Coachmark AnchorPress Cmd+K anywhere to jump between Methane component specs.
Ready · interact with <mth-coachmark>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/coachmark"></script>
<mth-coachmark placement="top" beacon>Example</mth-coachmark>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
openopenbooleanfalseControls whether the coachmark is visible.
targettargetstring""CSS selector resolving the anchor element in the document.
headingheadingstring""Title text rendered in the coachmark header.
placementplacement'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'"bottom"Preferred placement relative to the target element.
beaconbeaconbooleantrueDisplays an attention beacon indicator.
closableclosablebooleantrueRenders the header close icon button.
dismissLabeldismiss-labelstring""Custom label for the primary dismiss button.
stepstepnumber0Optional 1-based step index shown in the footer.
totaltotalnumber0Optional total number of steps shown alongside step.
forceFallbackforce-fallbackbooleanfalseForces JavaScript positioning fallback for deterministic testing.

Events

EventDetail TypeDescription
mth-openundefinedCancelable event fired before opening.
mth-after-openundefinedFired after opening.
mth-close{ reason: string }Cancelable event fired before closing.
mth-after-closeundefinedFired after closing.
mth-dismissundefinedFired when dismissed via the primary acknowledgement CTA.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EscapebothopenDismisses the coachmark and restores focus.

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 1 APG keyboard transitions across LTR/RTL.mth-coachmark.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open), :state(beacon).Conformance suite
i18nRoutes 4 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test