Magoo Component UI logo Magoo Component UI
← Catalog

Split Pane

split-pane organism experimental

A resizable two-pane layout with a draggable divider between a start and an end pane.

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default

Editor

Drag the divider between the two panes to resize them. The panes share the width according to the ratio prop, and the divider lets a reader adjust it live.

# heading
Some **markdown** content.

Preview

heading

Some markdown content.

SeventyThirty

Document

A wide primary pane with a narrow companion sidebar. The 70-30 ratio gives most of the room to the document while keeping the outline in view.

Outline

  • Introduction
  • Getting started
  • Configuration
  • Summary

Props

NameTypeReq
ratio enum (50-50 | 60-40 | 40-60 | 70-30)
start_label string
end_label string

Slots

  • start — Content of the leading (left) pane.
  • end — Content of the trailing (right) pane.

Related components

How to use

The start pane's width is driven by the --sp custom property set from the ratio prop, so the base render already shows the right split with no JavaScript. behavior.js wires the divider: it uses Pointer Events (pointerdown/move/up with setPointerCapture) to drag the start pane's flex-basis between 15% and 85%, and ArrowLeft/ArrowRight nudge it by 2% when the divider is focused. The divider is a role="separator" element with aria-orientation, aria-valuemin/max/now and tabindex, so it is keyboard-operable. All listeners are removed on cleanup.

Use cases

layoutcontainer WCAG AA SEO 20 dir: both ai-generated