Skip to content

Components

Resizable

Panels side by side or stacked, with handles a pointer drags and the arrow keys move; a layout can be remembered and a panel can fold to a strip.

Customize
Ombelle · light

Installation

Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.

pnpm dlx @ombelle-ui/cli@1.1.2 add resizable

Adds components/ui/resizable.tsx and installs react, react-resizable-panels, clsx, tailwind-merge with lifecycle scripts disabled. This is a client component.

In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.

Usage

example.tsx
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@/components/ui/resizable'
export function Example(){return <div style={{ blockSize: '20rem', border: '1px solid var(--border)' }}><ResizablePanelGroup direction="horizontal" autoSaveId="editor-split"><ResizablePanel defaultSize="60%" minSize="30%"><div style={{ padding: '1rem' }}>Preview</div></ResizablePanel><ResizableHandle withHandle aria-label="Resize preview and controls" /><ResizablePanel defaultSize="40%" minSize="20%" collapsible collapsedSize="3rem"><div style={{ padding: '1rem' }}>Controls</div></ResizablePanel></ResizablePanelGroup></div>}

API and states

API
ResizablePanelGroup (direction, autoSaveId, onLayoutChanged), ResizablePanel (defaultSize, minSize, maxSize, collapsible, collapsedSize, panelRef), ResizableHandle (withHandle)
Minimum states
Default, handle hover, handle focus, dragging, collapsed panel, vertical
Native basis
react-resizable-panels, one template for both editions
Styles
Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.