Resizable panels
A React component in Beamline's Layout category, in the free sample.
Panes that trade space across draggable dividers; each divider is a focusable separator with arrow keys, limits, folding for collapsible panes and double-click to restore.
Use it for
- Split views people resize: mail, editor and preview, list and detail.
Not for
- Fixed layouts whose sizes never change (CSS grid).
Anatomy
- root (unpainted; the caller's one m-surface frame holds the split)
- pane (unpainted, scrolls its own content)
- divider (1px line-soft seam, 13px hit area)
- grip (visible at rest; accent on hover, drag and focus)
Variants
- direction: horizontal, vertical
States
- rest (seam + grip)
- hover / dragging (seam lit 3px accent, grip accent)
- focus-visible (look's focus ring round the grip)
- folded (pane at 0, grip ink-3; Enter unfolds)
- folded by the room (a collapsible pane the room cannot hold; it comes back as the room grows, or on Enter)
- squeezed (a room too small for the open panes' minimums shares it in proportion)
Keyboard
- Each open pane is a named region reachable with Tab; native scrolling keys reach overflowing content
- ← → (↑ ↓ stacked) by 5%, Shift by 10%
- Home / End to the limits
- Enter folds or unfolds a collapsible neighbour (one the room folded stays open until the room is big enough again)
- Double-click a divider restores the starting sizes
Motion
The seam and grip light at once on hover or press and fade over --pui-motion-out. Under the pointer the panes follow with no easing; every other change of share (a key step, a fold, a double-click restore, the room folding a pane or giving it back) glides over --pui-duration-standard. Focus is never animated.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | The split's name, e.g. "Mail". |
direction | "horizontal" | "vertical" | "horizontal" | |
onLayoutChange | (sizes: number[]) => void | — | Sizes in percent after each change (drag end, key press). |
storageKey | string | — | Remember sizes in localStorage under this key. |
ResizablePanel | { id, label, defaultSize?, minSize? (px), maxSize? (px), collapsible? } | — | |
style / ref | CSSProperties / native Ref | — | style: Inline styles on the documented visual root; no overrides by default. ref: Receives the documented native target or imperative handle; omitted by default. |
classNames | ResizablePanelsClassNames | — | Classes for the named visual parts; no overrides by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented native target or imperative handle; omitted by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no overrides by default. |
className | string | — | Classes on the documented visual root; no override by default. |
children (required) | ReactNode | — | |
ResizablePanel.id (required) | string | — | |
ResizablePanel.defaultSize | number | — | On ResizablePanel: Share of the space at first, in percent. Shares are normalised to 100. |
ResizablePanel.minSize | number | — | On ResizablePanel: Smallest size in px. Default 80. |
ResizablePanel.maxSize | number | — | On ResizablePanel: Largest size in px. |
ResizablePanel.collapsible | boolean | — | On ResizablePanel: Dragging well past the minimum (or Enter on its divider) folds it away. |
Used in
Import
import { ResizablePanel, ResizablePanels } from "@beamline/resizable-panels";
Get it
Resizable panels is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Resizable panels is included in the free MIT sample. Get Beamline · Connect your agent
More in Layout
- Bezel: A double-bezel frame: an outer shell with a hairline, a small gap, and an inset panel with its own edge, so a preview, chart or media reads as set into…
- Carousel: A row of slides that snap into place: swipe on touch, drag or the arrows with a mouse, ← → when focused, or the dots; optional autoplay that pauses and…
- Card: A record or a small group of related content and actions: optional media, avatar, title, status, action, meta, free content and a Details toggle; plain…
- UI root: Makes a region of any app a Beamline root: theme, brand and direction for everything inside, and a matching layer at page level where its menus, dialogs…
- Expandable card: A dense card that grows in place when asked: the frame resizes and the clamped preview opens into the full text.
- Accordion: Topics that open in place, one at a time or several: FAQs and settings sections; each header is a button (with an optional fact at its end), and the…
- Collapsible: One region that opens and closes in place from its trigger, its height animating to the content.
- Scroll area: A native scroll region with thin overlay thumbs and edge fades that show only where more content waits; thumbs can be dragged or clicked.
- Aspect ratio: Holds media, video and embeds at a fixed width-to-height ratio while the layout resizes.
- Direction: Sets left-to-right or right-to-left for everything inside: text and logical spacing flip, and Radix parts read the direction for keys and placement.
- Separator: A hairline between groups, horizontal or vertical; hidden from screen readers unless it carries meaning.