ValyroUI Русская версия

Resizable Panels

Panels with draggable dividers. Free, MIT · Navigation and layout › Structure

Panels side by side or stacked, with handles between them; ResizablePanels.Panel and .Handle are the parts.

Installation

npx valyro-cli@latest add resizable-panels
npx shadcn@latest add https://valyro.xyz/r/resizable-panels.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { ResizablePanels } from 'valyro-ui';

Props

PropTypeDefault
direction'horizontal' | 'vertical''horizontal'horizontal puts panels side by side (following the reading direction); vertical stacks them.
layoutnumber[]Panel sizes in percent, in panel order. Controlled: pair with onLayout.
onLayout(layout: number[]) => voidCalled with the new sizes on every drag step, key press, collapse or expand, and when a saved layout is restored.
autoSaveIdstringRemembers the layout in localStorage under this id and restores it on mount (after hydration).
keyboardStepnumber2Percent an arrow key moves a focused handle; Shift moves five times as far.

Compound parts

ResizablePanels.Panel (ResizablePanel), ResizablePanels.Handle (ResizableHandle)

Related components

Previous: Sidebar · Next: Breadcrumbs · All Navigation and layout