compacto-ui

Search documentation

Jump to a page or a component.

Resizable

Split panes; the 1px rule claims a 12px invisible hit area.

peer: react-resizable-panels

Preview

Left
Right

Installation

No install — ask an AI agent to copy this component from registry.json, then pnpm add react-resizable-panels.

import { ResizableGroup, ResizableHandle, ResizablePanel } from "@/components/ui/resizable";

Notes

  • Optional peer: react-resizable-panels.
  • The handle renders as a 1px line but claims a 12px invisible hit area — a literal 1px drag target is unusable with a mouse and impossible with a trackpad.
  • data-testid and id are overwritten with generated values on the group and panels; react-resizable-panels claims them for layout persistence. Target [data-slot="resizable-group"] instead, or put your id on a wrapper.
  • ref yields the library's imperative panel-group handle, not the DOM node. className does pass through normally.

Props

The props worth knowing. Everything else passes straight through to the underlying element, including className, which is merged last so it always wins.

PropTypeDefaultDescription
orientation (Group)"horizontal" | "vertical"—Lay panels side by side, or stack them.
defaultSize / minSize (Panel)string—Passed through to react-resizable-panels.