← All Components
<mth-flow-editor>
Accessible node/DAG flow editor wrapping @dagrejs/dagre with pan/zoom plane and keyboard node traversal.
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-flow-editor>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/flow/flow-editor"></script>
<mth-flow-editor direction="TB" edge-style="bezier"></mth-flow-editor>import '@methane-ui/flow/flow-editor';
import '@methane-ui/react';
export function Example() {
return <mth-flow-editor direction="TB" edge-style="bezier"></mth-flow-editor>;
}<script setup lang="ts">
import '@methane-ui/flow/flow-editor';
</script>
<template>
<mth-flow-editor direction="TB" edge-style="bezier"></mth-flow-editor>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/flow/flow-editor';
import { MthFlowEditorDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthFlowEditorDirective],
template: `<mth-flow-editor direction="TB" edge-style="bezier"></mth-flow-editor>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/flow/flow-editor';
import MthFlowEditor from '@methane-ui/svelte/MthFlowEditor.svelte';
</script>
<MthFlowEditor direction="TB" edge-style="bezier"></MthFlowEditor>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
nodes | — | ReadonlyArray<unknown> | — | Flow node definitions. |
edges | — | ReadonlyArray<unknown> | — | Directed edges connecting source and target node IDs. |
direction | direction | 'TB' | 'LR' | 'RL' | 'BT' | 'auto' | "auto" | DAG layout rank direction (auto resolves LR/RL from document direction). |
edgeStyle | edge-style | 'bezier' | 'orthogonal' | "bezier" | Connector routing geometry (bezier or orthogonal). |
zoom | zoom | number | 1 | Viewport scale factor. |
panX | pan-x | number | 0 | Horizontal pan offset in pixels. |
panY | pan-y | number | 0 | Vertical pan offset in pixels. |
selectedId | selected-id | string | "" | Currently selected node ID. |
autoLayout | auto-layout | boolean | true | Runs Dagre DAG auto-layout automatically when nodes/edges update. |
label | label | string | "" | Accessible region label. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-node-select | { nodeId: string } | Fired when a flow node is selected. |
mth-viewport-change | { zoom: number; panX: number; panY: number } | Fired when pan or zoom changes. |
mth-layout-complete | { nodeCount: number; edgeCount: number } | Fired after Dagre layout computes coordinates. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | ltr | Focus is on a node inside the flow editor | Moves focus to the next node |
| ArrowLeft | ltr | Focus is on a node after the first node | Moves focus to the previous node |
| Enter | both | Focus is on a node | Selects the node and emits mth-node-select |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | 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-flow-editor.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(empty). | Conformance suite |
| i18n | Routes 9 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |