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

<mth-fab>

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

Floating Action Button supporting compact circular, extended pill, and logical viewport corner placement.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/fab"></script>
<mth-fab variant="primary" size="sm">Example</mth-fab>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
labellabelstring""Accessible label (aria-label when icon-only, fallback text when extended).
variantvariant'primary' | 'surface' | 'secondary'"primary"Visual treatment (primary, surface, or secondary).
sizesize'sm' | 'md' | 'lg'"md"Dimension scale (sm, md, or lg).
extendedextendedbooleanfalseDisplays text label alongside the icon.
disableddisabledbooleanfalseDisables interaction.
fixedfixedbooleanfalsePins the FAB to a logical viewport corner using placement.
placementplacement'bottom-end' | 'bottom-start' | 'top-end' | 'top-start'"bottom-end"Logical corner placement when fixed is enabled.

Events

EventDetail TypeDescription
mth-press{ originalEvent: Event }Cancelable event fired when the FAB is activated.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EnterbothFAB is focused and enabledEmits mth-press
bothFAB is focused and enabledEmits mth-press

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 2 APG keyboard transitions across LTR/RTL.mth-fab.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled), :state(extended).Conformance suite
i18nRoutes 1 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test