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

<mth-floor-plan>

@methane-ui/maps~9.0 KB brotli shell + lazy engine~2.6 KB shell · lazy engine chunk

Interactive indoor vector floor plan with zoom/pan controls and roving accessible room directory.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/maps/floor-plan"></script>
<mth-floor-plan level="1" zoom="1"></mth-floor-plan>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
rooms—ReadonlyArray<unknown>—Array of FloorPlanRoom definitions.
selectedIds—ReadonlyArray<string>—Currently selected room identifiers.
levellevelstring"1"Active building floor/level identifier.
zoomzoomnumber1Viewport zoom multiplier (0.5 to 4).
panXpan-xnumber0Horizontal pan offset in pixels.
panYpan-ynumber0Vertical pan offset in pixels.
multiplemultiplebooleanfalseAllows selecting multiple rooms concurrently.
labellabelstring""Accessible region label.

Events

EventDetail TypeDescription
mth-room-select{ selectedIds: ReadonlyArray<string>; room: unknown }Fired when an enabled room is selected or toggled.
mth-floor-zoom{ zoom: number; panX: number; panY: number }Fired when viewport zoom or pan changes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowLeftltrroom directory focusedMoves focus to previous room
ArrowRightltrroom directory focusedMoves focus to next room
Enterbothroom focusedSelects or toggles room

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 3 APG keyboard transitions across LTR/RTL.mth-floor-plan.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(multiple).Conformance suite
i18nRoutes 8 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test