← All Components
<mth-floor-plan>
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
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>import '@methane-ui/maps/floor-plan';
import '@methane-ui/react';
export function Example() {
return <mth-floor-plan level="1" zoom="1"></mth-floor-plan>;
}<script setup lang="ts">
import '@methane-ui/maps/floor-plan';
</script>
<template>
<mth-floor-plan level="1" zoom="1"></mth-floor-plan>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/maps/floor-plan';
import { MthFloorPlanDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthFloorPlanDirective],
template: `<mth-floor-plan level="1" zoom="1"></mth-floor-plan>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/maps/floor-plan';
import MthFloorPlan from '@methane-ui/svelte/MthFloorPlan.svelte';
</script>
<MthFloorPlan level="1" zoom="1"></MthFloorPlan>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
rooms | — | ReadonlyArray<unknown> | — | Array of FloorPlanRoom definitions. |
selectedIds | — | ReadonlyArray<string> | — | Currently selected room identifiers. |
level | level | string | "1" | Active building floor/level identifier. |
zoom | zoom | number | 1 | Viewport zoom multiplier (0.5 to 4). |
panX | pan-x | number | 0 | Horizontal pan offset in pixels. |
panY | pan-y | number | 0 | Vertical pan offset in pixels. |
multiple | multiple | boolean | false | Allows selecting multiple rooms concurrently. |
label | label | string | "" | Accessible region label. |
Events
| Event | Detail Type | Description |
|---|---|---|
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
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowLeft | ltr | room directory focused | Moves focus to previous room |
| ArrowRight | ltr | room directory focused | Moves focus to next room |
| Enter | both | room focused | Selects or toggles room |
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 3 APG keyboard transitions across LTR/RTL. | mth-floor-plan.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(multiple). | Conformance suite |
| i18n | Routes 8 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |