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

<mth-hover-card>

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

Rich preview card anchored to a trigger with progressive interestfor enhancement, hover/focus timers, and dual-path CSS Anchor / JS 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

Interactive StageLive Custom Element · <mth-hover-card> (@methane-ui/ui)
Hover or focus @methane-ui/ui
@methane-ui/ui@0.1.0

167 accessible Web Components with OKLCH tokens and SSR hydration.

Ready · interact with <mth-hover-card>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/hover-card"></script>
<mth-hover-card placement="top" open-delay="200">Example</mth-hover-card>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
openopenbooleanfalseWhether the hover card popup is open.
placementplacement'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'"bottom"Preferred floating placement relative to the trigger.
openDelayopen-delaynumber200Delay in milliseconds before opening on hover or focus.
closeDelayclose-delaynumber300Delay in milliseconds before closing after pointer or focus leaves.
disableddisabledbooleanfalsePrevents the hover card from opening interactively.
forceFallbackforce-fallbackbooleanfalseForces JavaScript fallback positioning instead of CSS Anchor Positioning.
labellabelstring""Accessible label applied to the floating hover card dialog surface.

Events

EventDetail TypeDescription
mth-openundefinedCancelable event dispatched before the hover card opens.
mth-after-openundefinedDispatched after the hover card opens.
mth-closeundefinedCancelable event dispatched before the hover card closes.
mth-after-closeundefinedDispatched after the hover card closes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EscapebothopenCloses the open hover card and restores focus to trigger.

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-hover-card.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open).Conformance suite
i18nRoutes 1 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test