JGuang / JGuang UI
Components组件Base UIBase UI 组件

Resizable

Accessible resizable panel groups and layouts with keyboard support.

Partially translated: Chinese navigation, titles, descriptions, and common headings. The technical body is currently in English.
Loading JGuang UI example…

About

The Resizable component is built on top of react-resizable-panels by bvaughn.

Installation

Command

Manual

Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.

Install the following dependencies:

npm install react-resizable-panels

Copy and paste the following code into your project.

View complete source: components/ui/resizable.tsx

Update the import paths to match your project setup.

Usage

import {
  ResizableHandle,
  ResizablePanel,
  ResizablePanelGroup,
} from "@/components/ui/resizable"
<ResizablePanelGroup orientation="horizontal">
  <ResizablePanel>One</ResizablePanel>
  <ResizableHandle />
  <ResizablePanel>Two</ResizablePanel>
</ResizablePanelGroup>

Composition

Use the following composition to build a ResizablePanelGroup:

ResizablePanelGroup
├── ResizablePanel
├── ResizableHandle
└── ResizablePanel

Vertical

Use orientation="vertical" for vertical resizing.

Loading JGuang UI example…

Handle

Use the withHandle prop on ResizableHandle to show a visible handle.

Loading JGuang UI example…

RTL

To enable RTL support in JGuang UI, see the RTL configuration guide.

Loading JGuang UI example…

API Reference

See the react-resizable-panels documentation.

Changelog

2025-02-02 react-resizable-panels v4

Updated to react-resizable-panels v4. See the v4.0.0 release notes for full details.

If you're using react-resizable-panels primitives directly, note the following changes:

v3v4
PanelGroupGroup
PanelResizeHandleSeparator
direction proporientation prop
defaultSize={50}defaultSize="50%"
onLayoutonLayoutChange
ImperativePanelHandlePanelImperativeHandle
ref prop on PanelpanelRef prop
data-panel-group-directionaria-orientation

The JGuang UI wrapper components (ResizablePanelGroup, ResizablePanel, ResizableHandle) remain unchanged.

Source: components/base/resizable.mdx

Technical documentation for JGuang UI.

On this page