Skip to content

Design system

Documentation

DesignComponents / Splitter

Components / Splitter

Stable

Splitter

Resize adjacent panels with pointer and keyboard controls and bounded percentages.

On this page

Examples

Side-by-side panels

Drag the separator or use arrow keys to resize the primary panel.

Projects

Choose a project from the list.

Project details

The detail pane grows with the remaining space.

Workspace panel splitter

Stacked panels

Vertical orientation places the separator between top and bottom panels.

Editor
Terminal

Vertical editor splitter

Collapse a panel

Double-click the handle to switch the primary panel between its minimum and maximum size.

Inspector
Canvas

Collapsible inspector splitter

Stack at narrow widths

A horizontal splitter stacks its panels when the component container is under 640px wide.

Navigation panel
Content panel

Responsive splitter that stacks in a narrow container

Try the splitter

Inspect bounded panel sizes and the keyboard separator.

Navigation pane
Content pane

Splitter property playground

Usage

import { Splitter } from "@phuctech/ui/components/splitter";

<Splitter label="Workspace panels" primary={<Navigation />} secondary={<Editor />} />

Interaction

Horizontal orientation places panels side by side; vertical orientation stacks them. Set responsive on a horizontal splitter to stack it when its container becomes narrower than 640px; a ResizeObserver tracks the container so nested layouts respond to their available space. The separator supports pointer dragging, orientation-specific arrow keys, Home/End for the configured bounds, and optional double-click collapse to the minimum/maximum. Values are percentages of the available primary axis; give the parent a measurable width or height. Keep headers and independent actions inside the panel content, and use each panel's own bounded scroll region for long content.

API

Component API
PropTypeDefaultDescriptionConstraints
label / primary / secondarystring / ReactNode / ReactNoderequiredNames the splitter and supplies its two panel contents.Use a short, unique label for the separator and both regions.
value / defaultValuenumber50Controlled or initial primary-panel percentage.Clamped within minSize and maxSize.
onValueChange(value: number) => void—Reports the next primary-panel percentage.The feature owns persistence across sessions.
orientation"horizontal" | "vertical""horizontal"Chooses side-by-side or stacked panels.The separator's aria-orientation reflects its physical axis.
responsivebooleanfalseStacks horizontal panels below 640px of container width.Vertical orientation is already stacked; responsive uses ResizeObserver.
minSize / maxSizenumber15 / 85Panel percentage bounds.Values are normalized to 0–100 and max remains greater than min.
collapsiblebooleanfalseEnables double-click between minimum and maximum.The panel is bounded at minSize rather than removed from the layout.
disabledbooleanfalsePrevents pointer and keyboard resizing.The separator is removed from tab focus.

Accessibility

The handle is a labeled separator exposing its value bounds and current value. Arrow keys resize along the split axis, while Home/End reach the bounds. Pointer input is not the only interaction path.

  • Drawer provides an edge panel for temporary narrow-screen content.
  • Card organizes stable panel content.