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

<mth-floating-panel>

@methane-ui/ui~7.9 KB brotli (cold + Lit)~2.0 KB marginal

Non-modal floating utility panel using OverlayController with pointer/keyboard drag positioning, docking, and minimization.

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-floating-panel> (@methane-ui/ui)
Open Floating PanelLive Token InspectorDrag header, minimize, or dock to viewport edges.
Ready · interact with <mth-floating-panel>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/floating-panel"></script>
<mth-floating-panel dock="none" x="24">Example</mth-floating-panel>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
openopenbooleanfalseControls whether the floating panel is visible.
labellabelstring""Accessible heading and region label.
minimizedminimizedbooleanfalseCollapses the panel body while keeping the header bar visible.
dockdock'none' | 'start' | 'end' | 'bottom'"none"Docks the panel to start, end, bottom, or floats freely (none).
xxnumber24Horizontal offset in pixels while floating.
yynumber24Vertical offset in pixels while floating.
closableclosablebooleantrueRenders the close button in the header.
minimizableminimizablebooleantrueRenders the minimize/restore toggle button.
dockabledockablebooleantrueRenders the dock toggle button.
closeOnEscapeclose-on-escapebooleantrueAllows closing the panel on Escape.

Events

EventDetail TypeDescription
mth-openundefinedCancelable event fired before opening the panel.
mth-after-openundefinedFired after the panel opens.
mth-close{ reason: string }Cancelable event fired before closing the panel.
mth-after-closeundefinedFired after the panel closes.
mth-move{ x: number; y: number }Fired when the panel position (x, y) updates.
mth-minimize-change{ minimized: boolean }Fired when minimized state toggles.
mth-dock-change{ dock: 'none' | 'start' | 'end' | 'bottom' }Fired when dock mode changes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EscapebothopenCloses the floating panel when closeOnEscape is enabled.
ArrowUpbothdrag-handle focusedNudges the floating panel upward.
ArrowDownbothdrag-handle focusedNudges the floating panel downward.
ArrowLeftbothdrag-handle focusedNudges the floating panel toward inline-start.
ArrowRightbothdrag-handle focusedNudges the floating panel toward inline-end.

Accessibility Checklist

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