Skip to content
IndexRequest a UIAboutContact

Split Pane Resizer

Two panes divided by a draggable separator that also works with arrow keys, with presets and a minimum width.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean UI design of a two-pane app window: a narrow file list on the left and a wide document preview on the right, separated by a thin vertical divider with a small grip of three dots in the middle, the left pane highlighted slightly, light neutral theme, rounded window corners, subtle shadow, flat modern interface, a small label showing 35 percent and 65 percent. Variants: divider at 50 percent and 70 percent, and a hover state with a darker divider line. Negative: heavy borders, gradients, text errors, cursor, clutter. Reduced motion: static design.

About this pattern

Definition

A split pane lets the user decide how much room each side gets. The divider is a separator role element that can be dragged, moved with arrow keys and reset by double click or Enter, so mouse, touch and keyboard users all have control.

Purpose & UX principles

  • Give the divider a wide invisible hit area (about 12px) around a thin visible line.
  • Set a minimum size for each pane so neither can be dragged to nothing.
  • Expose aria-valuenow, min and max so assistive technology can report the position.

Interaction states

  • Three presets, drag, arrow keys, Home and End, and double click to reset.

Motion specification

  • Dragging follows the pointer with no easing; presets animate over 200ms.
  • Reduced motion: presets jump without animating.

Responsive behaviour

  • On narrow screens stack the panes and hide the divider.
  • Remember the position per user if the layout is important.

Code

HTML
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Presets"><button data-p="0" aria-pressed="true">30 / 70</button><button data-p="1" aria-pressed="false">50 / 50</button><button data-p="2" aria-pressed="false">70 / 30</button></div><div class="sp" id="sp"><div class="pa" id="pa"><b>Files</b><span id="lw">35%</span></div><div class="dv" id="dv" role="separator" tabindex="0" aria-orientation="vertical" aria-label="Resize panes" aria-valuemin="20" aria-valuemax="80" aria-valuenow="35"><i></i></div><div class="pb"><b>Preview</b><span id="rw">65%</span></div></div><p class="out">Drag the divider, or focus it and use the arrow keys. Double click resets.</p></div>

Related patterns

Sticky Header that Shrinks

↗
Sticky Header that ShrinksLayout & Scrolling

Reading Progress Bar

↗
Reading Progress BarLayout & Scrolling

Bento Grid

↗
Bento GridLayout Structures