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

<mth-lottie>

@methane-ui/media~7.9 KB brotli shell + lazy engine~2.0 KB shell · lazy engine chunk

Accessible DotLottie animation player wrapping @lottiefiles/dotlottie-web with reduced-motion support.

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-lottie> (@methane-ui/media)
Ready · interact with <mth-lottie>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/media/lottie"></script>
<mth-lottie loop speed="1"></mth-lottie>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
srcsrcstring""Animation asset URL validated against the safe URL allowlist.
autoplayautoplaybooleanfalseStarts animation automatically unless prefers-reduced-motion is active.
looploopbooleantrueRepeats the animation continuously.
speedspeednumber1Playback speed multiplier (> 0).
playingplayingbooleanfalseWhether playback is active.
controlscontrolsbooleantrueDisplays built-in play/pause and stop controls.
disableddisabledbooleanfalseDisables playback controls.
labellabelstring""Accessible region label.
animationData—unknown | undefined—Inline Lottie JSON/buffer payload passed to DotLottie.

Events

EventDetail TypeDescription
mth-play{ speed: number; loop: boolean }Fired when animation playback starts.
mth-pause{ speed: number }Fired when animation playback pauses.
mth-stopvoidFired when animation playback stops.
mth-error{ reason: string }Fired when an invalid source URL is blocked.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EnterbothFocus is on the play/pause buttonToggles animation playback unless prefers-reduced-motion is active

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).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-lottie.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(playing), :state(frozen), :state(disabled).Conformance suite
i18nRoutes 6 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test