← All Components
<mth-split-pane>
Two-pane splitter with accessible role="separator" keyboard control, pointer-capture drag resizing, and CSP-safe adopted stylesheet layout.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Source Spec (45%)
Live Preview (55%)
Ready · interact with <mth-split-pane>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/split-pane"></script>
<mth-split-pane orientation="horizontal" ratio="50"></mth-split-pane>import '@methane-ui/ui/split-pane';
import '@methane-ui/react';
export function Example() {
return <mth-split-pane orientation="horizontal" ratio="50"></mth-split-pane>;
}<script setup lang="ts">
import '@methane-ui/ui/split-pane';
</script>
<template>
<mth-split-pane orientation="horizontal" ratio="50"></mth-split-pane>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/split-pane';
import { MthSplitPaneDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthSplitPaneDirective],
template: `<mth-split-pane orientation="horizontal" ratio="50"></mth-split-pane>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/split-pane';
import MthSplitPane from '@methane-ui/svelte/MthSplitPane.svelte';
</script>
<MthSplitPane orientation="horizontal" ratio="50"></MthSplitPane>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
orientation | orientation | 'horizontal' | 'vertical' | "horizontal" | Split axis (horizontal side-by-side or vertical stacked). |
ratio | ratio | number | 50 | Start pane percentage from minRatio to maxRatio. |
minRatio | min-ratio | number | 0 | Minimum allowed start pane percentage. |
maxRatio | max-ratio | number | 100 | Maximum allowed start pane percentage. |
step | step | number | 5 | Arrow key increment in percentage points. |
stepLarge | step-large | number | 15 | PageUp/PageDown increment in percentage points. |
disabled | disabled | boolean | false | Disables pointer and keyboard resizing. |
label | label | string | "" | Accessible aria-label for the divider separator. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-resize | { ratio: number } | Fired whenever the split ratio changes via pointer or keyboard. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowLeft | both | Horizontal divider separator is focused | Adjusts split ratio toward start (or end in RTL) |
| ArrowRight | both | Horizontal divider separator is focused | Adjusts split ratio toward end (or start in RTL) |
| ArrowUp | both | Vertical divider separator is focused | Decreases start pane ratio |
| ArrowDown | both | Vertical divider separator is focused | Increases start pane ratio |
| Home | both | Divider separator is focused | Sets ratio to minRatio |
| End | both | Divider separator is focused | Sets ratio to maxRatio |
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 6 APG keyboard transitions across LTR/RTL. | mth-split-pane.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(dragging). | Conformance suite |
| i18n | Routes 1 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |