Component guideEditable source

Resizable

A split layout whose panels can be resized with a separator.

Original component docs
On this page4 sectionsBack to top

Use Resizable for workspaces, inspectors, and editors. Give the group a bounded size and each panel a useful minimum. The wrappers use the current react-resizable-panels API directly: numeric sizes are pixels; use explicit strings such as "35%" for percentages.

Live preview
Loading preview...

#Installation

Complete the base setup. For manual installation:

npx shadcn@latest add https://neobrutal-ui.andongmin.com/r/resizable.json

#Usage

import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "@/components/ui/resizable";

export default function SplitWorkspace() {
  return (
    <ResizablePanelGroup
      orientation="horizontal"
      className="min-h-48 rounded-base border-2 border-border"
    >
      <ResizablePanel defaultSize="35%" minSize="20%">
        <div className="p-4">Files</div>
      </ResizablePanel>
      <ResizableHandle withHandle aria-label="Resize file panel" />
      <ResizablePanel defaultSize="65%" minSize="30%">
        <div className="p-4">Editor</div>
      </ResizablePanel>
    </ResizablePanelGroup>
  );
}

#API reference

Prop / partPurposeDefault
ResizablePanelGroup.orientationSplit directionhorizontal
ResizablePanel.defaultSizeInitial size; number = pixels, "35%" = percentageDistributed by group
ResizablePanel.minSize / maxSizeResize constraints in the same unitsUpstream defaults
ResizablePanel.collapsibleAllow collapsefalse
ResizablePanel.panelRefNative panel imperative handleUnset
ResizablePanelGroup.groupRefNative group imperative handleUnset
ResizablePanelGroup.onLayoutChangedReceive the native layout after resizingUnset
ResizableHandle.withHandleDisplay a gripfalse
ResizableHandle.disabledPrevent adjustmentfalse

For persisted layouts, use useDefaultLayout from react-resizable-panels and pass its returned layout properties to the group. The wrappers do not implement a second storage system, translate callbacks, or reinterpret native size units.

#Accessibility

Name separators meaningfully. Keep controls usable at the smallest panel size and test keyboard resizing as well as dragging. Set an explicit height for vertical layouts. Use responsive CSS when a split workspace is unsuitable for narrow screens; resizing alone is not a mobile layout.