← All Components
<mth-floating-panel>
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
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>import '@methane-ui/ui/floating-panel';
import '@methane-ui/react';
export function Example() {
return <mth-floating-panel dock="none" x="24">Example</mth-floating-panel>;
}<script setup lang="ts">
import '@methane-ui/ui/floating-panel';
</script>
<template>
<mth-floating-panel dock="none" x="24">Example</mth-floating-panel>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/floating-panel';
import { MthFloatingPanelDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthFloatingPanelDirective],
template: `<mth-floating-panel dock="none" x="24">Example</mth-floating-panel>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/floating-panel';
import MthFloatingPanel from '@methane-ui/svelte/MthFloatingPanel.svelte';
</script>
<MthFloatingPanel dock="none" x="24">Example</MthFloatingPanel>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
open | open | boolean | false | Controls whether the floating panel is visible. |
label | label | string | "" | Accessible heading and region label. |
minimized | minimized | boolean | false | Collapses the panel body while keeping the header bar visible. |
dock | dock | 'none' | 'start' | 'end' | 'bottom' | "none" | Docks the panel to start, end, bottom, or floats freely (none). |
x | x | number | 24 | Horizontal offset in pixels while floating. |
y | y | number | 24 | Vertical offset in pixels while floating. |
closable | closable | boolean | true | Renders the close button in the header. |
minimizable | minimizable | boolean | true | Renders the minimize/restore toggle button. |
dockable | dockable | boolean | true | Renders the dock toggle button. |
closeOnEscape | close-on-escape | boolean | true | Allows closing the panel on Escape. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-open | undefined | Cancelable event fired before opening the panel. |
mth-after-open | undefined | Fired after the panel opens. |
mth-close | { reason: string } | Cancelable event fired before closing the panel. |
mth-after-close | undefined | Fired 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
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Escape | both | open | Closes the floating panel when closeOnEscape is enabled. |
| ArrowUp | both | drag-handle focused | Nudges the floating panel upward. |
| ArrowDown | both | drag-handle focused | Nudges the floating panel downward. |
| ArrowLeft | both | drag-handle focused | Nudges the floating panel toward inline-start. |
| ArrowRight | both | drag-handle focused | Nudges the floating panel toward inline-end. |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="host". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 5 APG keyboard transitions across LTR/RTL. | mth-floating-panel.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(open), :state(minimized), :state(docked), :state(dragging). | Conformance suite |
| i18n | Routes 8 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |