Skip to content

SplitPane

Two panes with one divider, such as a form beside its live preview. The divider snaps to the given points while it is dragged, and storageKey keeps the width per screen. Use SplitView for three or more panes.

  • SplitPane
Status
Stable
axe:
Light, Dark, High contrast
Unit tests:
yes
Keyboard pass:
not yet
Screen reader pass:
not yet
Used in:
no app yet

PreviewLink to the section Preview

Live in all three themes. Everything here is interactive.

Light theme, SplitPane

Drag the line or focus it: arrows move it by 1%, Page Up and Page Down jump to a third, a half and two thirds, Enter folds the form away, a double click resets. The width is kept for this page.

Opening hours

Open from Monday to Friday, 9:00 to 17:00.

Dark theme, SplitPane

Drag the line or focus it: arrows move it by 1%, Page Up and Page Down jump to a third, a half and two thirds, Enter folds the form away, a double click resets. The width is kept for this page.

Opening hours

Open from Monday to Friday, 9:00 to 17:00.

High contrast theme, SplitPane

Drag the line or focus it: arrows move it by 1%, Page Up and Page Down jump to a third, a half and two thirds, Enter folds the form away, a double click resets. The width is kept for this page.

Opening hours

Open from Monday to Friday, 9:00 to 17:00.

UsageLink to the section Usage

tsx
import { SplitPane } from '@skribly/ui/shell'
tsx
<SplitPane
  label="Resize the form"
  startLabel="Form"
  endLabel="Preview"
  defaultSize={40}
  snapPoints={[33, 50, 66]}
  storageKey="editor:split:pages"
  start={<PageForm />}
  end={<PreviewFrame … />}
/>

Every label is a prop, so the app passes its own words in its own language. See no built-in text.

AccessibilityLink to the section Accessibility

  • The divider is a focusable separator named by label, with aria-valuenow, aria-valuemin and aria-valuemax in percent of the first pane (valueText adds words), and aria-controls pointing at that pane.
  • Arrow keys move it by step and follow the reading direction, Page Up and Page Down jump between snap points, Home and End go to the limits, Enter collapses and restores, a double click resets.
  • On a touch screen its target is 44 pixels wide. startLabel and endLabel make the panes named regions.

This demo runs through axe in all three themes on every test run. See what the tests check.

Search this site

Arrows move through the results, Enter opens one, Esc closes. Ctrl K /