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

<mth-banner>

@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginal

Full-width announcement and system notice banner supporting semantic variants, sticky positioning, inline actions, and cancelable dismissal.

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-banner> (@methane-ui/ui)
Upgrade with pnpm add @methane-ui/ui@latest.Release Notes
Ready · interact with <mth-banner>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/banner"></script>
<mth-banner variant="info">Example</mth-banner>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
variantvariant'info' | 'success' | 'warning' | 'danger' | 'neutral'"info"Visual tone (info, success, warning, danger, or neutral).
dismissibledismissiblebooleanfalseRenders a close button to dismiss the banner.
dismisseddismissedbooleanfalseHides the banner when true.
stickystickybooleanfalsePins the banner to the top edge via position: sticky.
headingheadingstring""Optional short summary heading.

Events

EventDetail TypeDescription
mth-dismissundefinedCancelable event fired before dismissing the banner.

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
statesExposes ElementInternals CustomStateSet flags: :state(dismissed), :state(sticky).Conformance suite
i18nRoutes 2 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test