Black Friday is here 🔥 Get Wensity Pro for 20% less with

Resizable

React resizable panels and split panes with drag and keyboard handles, min and max sizes, collapsible panels, and layouts saved to local storage.

Loading preview

Examples

Practical examples and common states for the same installable component.

Horizontal

Splits layouts side-by-side using horizontal cursor resizes.

examples/resizable-horizontal.tsx
import { ResizableGroup, ResizablePanel, ResizableHandle } from "@/components/wensity/resizable";
export function ResizableHorizontal() {
return (
<div className="h-[160px] w-[340px] border border-zinc-200 bg-white dark:border-white/[0.06] dark:bg-[#0c0c0e] rounded-xl overflow-hidden">
<ResizableGroup direction="horizontal">
<ResizablePanel defaultSize={40} className="bg-zinc-50 dark:bg-[#111114] text-zinc-700 dark:text-zinc-500">Explorer</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={60} className="text-zinc-600 dark:text-zinc-400">Workspace</ResizablePanel>
</ResizableGroup>
</div>
);
}

Vertical

Splits panels top-to-bottom using vertical handles.

examples/resizable-vertical.tsx
import { ResizableGroup, ResizablePanel, ResizableHandle } from "@/components/wensity/resizable";
export function ResizableVertical() {
return (
<div className="h-[180px] w-[300px] border border-zinc-200 bg-white dark:border-white/[0.06] dark:bg-[#0c0c0e] rounded-xl overflow-hidden">
<ResizableGroup direction="vertical">
<ResizablePanel defaultSize={60} className="text-zinc-600 dark:text-zinc-400">File.tsx</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={40} className="bg-zinc-50 dark:bg-[#111114] text-zinc-700 dark:text-zinc-500">Debugger</ResizablePanel>
</ResizableGroup>
</div>
);
}

Multi Panel

Supports splitting across three or more panels synchronously.

examples/resizable-multi-panel.tsx
import { ResizableGroup, ResizablePanel, ResizableHandle } from "@/components/wensity/resizable";
export function ResizableMultiPanel() {
return (
<div className="h-[160px] w-[340px] border border-zinc-200 bg-white dark:border-white/[0.06] dark:bg-[#0c0c0e] rounded-xl overflow-hidden">
<ResizableGroup direction="horizontal">
<ResizablePanel defaultSize={20} className="bg-zinc-50 dark:bg-[#111114] text-zinc-700 dark:text-zinc-500">Tree</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={60} className="text-zinc-600 dark:text-zinc-400">Editor</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={20} className="bg-zinc-50 dark:bg-[#111114] text-zinc-700 dark:text-zinc-500">Outline</ResizablePanel>
</ResizableGroup>
</div>
);
}

Collapsible

Panel snaps shut to size 0 if dragged past its min size threshold.

examples/resizable-collapsible.tsx
import { ResizableGroup, ResizablePanel, ResizableHandle } from "@/components/wensity/resizable";
export function ResizableCollapsible() {
return (
<div className="h-[160px] w-[340px] border border-zinc-200 bg-white dark:border-white/[0.06] dark:bg-[#0c0c0e] rounded-xl overflow-hidden">
<ResizableGroup direction="horizontal">
<ResizablePanel defaultSize={30} minSize={20} collapsible className="bg-zinc-50 dark:bg-[#111114] text-zinc-700 dark:text-zinc-500">Left</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={70} className="text-zinc-600 dark:text-zinc-400">Center Content</ResizablePanel>
</ResizableGroup>
</div>
);
}

Persistent

Stores size mappings in localStorage to retain sizes across page reloads.

examples/resizable-persistent.tsx
import { ResizableGroup, ResizablePanel, ResizableHandle } from "@/components/wensity/resizable";
export function ResizablePersistent() {
return (
<div className="h-[160px] w-[340px] border border-zinc-200 bg-white dark:border-white/[0.06] dark:bg-[#0c0c0e] rounded-xl overflow-hidden">
<ResizableGroup direction="horizontal" storageKey="workspace-layout">
<ResizablePanel defaultSize={35} className="bg-zinc-50 dark:bg-[#111114] text-zinc-700 dark:text-zinc-500">Persistent Sidebar</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={65} className="text-zinc-600 dark:text-zinc-400">Reload page to verify</ResizablePanel>
</ResizableGroup>
</div>
);
}

Overview

Resizable is a React and Tailwind CSS split pane, in Next.js or any React app, written without react-resizable-panels or any other dependency. ResizableGroup lays out ResizablePanel children horizontally or vertically in percentages, each with a defaultSize, minSize, and maxSize. Handles carry the separator role with live aria values, respond to arrow keys in 2 percent steps or 10 with Shift, and jump to the limits with Home and End. Collapsible panels snap shut below half their minimum, and a double click toggles them. Pass storageKey to save the layout in localStorage. Vertical groups need a fixed height on the group.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add resizable

Usage

Import Resizable from @/components/wensity/resizable and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import {
ResizableGroup,
ResizablePanel,
ResizableHandle,
} from "@/components/wensity/resizable";
export function ResizableDemo() {
return (
<div className="h-[200px] w-full border border-zinc-200 rounded-xl overflow-hidden">
<ResizableGroup direction="horizontal">
<ResizablePanel defaultSize={30}>Sidebar</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={70}>Main Panel</ResizablePanel>
</ResizableGroup>
</div>
);
}

Props

PropTypeDefaultDescription
direction"horizontal" | "vertical""horizontal"Axis the panels are split along.
storageKeystring-When set, panel sizes persist to localStorage under this key.
  • Image Comparison Slider component preview

    Image Comparison Slider

    Drag the handle to wipe between before and after images with absolutely zero lag.

  • Bento Grid Layout component preview

    Bento Grid Layout

    A responsive bento grid of dashboard tiles where clicking one moves it to the front and the rest glide into place.

  • Fluid Drag-and-Drop Kanban component preview

    Fluid Drag-and-Drop Kanban

    A Trello-grade board running real pointer physics, where every card tilts toward the velocity you throw it across at.

  • Genie Effect component preview

    Genie Effect

    A macOS genie minimize built on a real per-slice warp that sucks any window, folder, or panel down into a waiting dock.