Resizable

키보드 접근성을 지원하는 크기 조절 패널 그룹과 레이아웃입니다.

1번 영역
2번 영역
3번 영역
examples/krds/resizable-demo.tsx
import {
  ResizableHandle,
  ResizablePanel,

개요

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

설치

pnpm dlx shadcn@latest add https://krdscn.gwlee.kr/r/resizable.json

사용법

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

구성

다음 조합으로 ResizablePanelGroup:

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

예제

Vertical

Use orientation="vertical" for vertical resizing.

헤더 영역
본문 영역
examples/krds/resizable-vertical.tsx
import {
  ResizableHandle,
  ResizablePanel,

Handle

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

측면 메뉴
본문 영역
examples/krds/resizable-handle.tsx
import {
  ResizableHandle,
  ResizablePanel,

RTL

RTL 지원을 활성화하려면 RTL 설정 가이드를 참고하세요.

واحد
اثنان
ثلاثة
examples/krds/resizable-rtl.tsx
"use client"

import * as React from "react"

API 참조

react-resizable-panels 문서를 참고하세요.

변경 내역

2025-02-02 react-resizable-panels v4

Updated to react-resizable-panels v4. 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 krdscn/ui wrapper components (ResizablePanelGroup, ResizablePanel, ResizableHandle) remain unchanged.