Skip to main content

Resizable

Accessible panel groups separated by handles that spring thicker on fine-pointer hover, snap-collapse past minSize, and double-click reset to defaults.

Explorer25%
Workspace50%
Inspector25%
Drag past minSize to snap collapse, double-click to reset, or press Enter.

Customize

Speed1

Installation

npx shadcn@latest add @kinetic/resizable

Usage

ResizablePanelGroup manages panel ratios using flexBasis percentages without external panel-layout dependencies. Handles respond to 1:1 pointer dragging, keyboard arrow keys (ArrowLeft/ArrowRight or ArrowUp/ArrowDown, Shift for larger jumps, Home/End, and Enter to toggle collapse), double-click reset, and spring-driven hover grip expansion.

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

interface SplitWorkspaceProps {
  readonly leftTitle: string;
  readonly rightTitle: string;
}

export function SplitWorkspace({ leftTitle, rightTitle }: SplitWorkspaceProps) {
  return (
    <ResizablePanelGroup
      direction="horizontal"
      className="h-56 w-full rounded-lg border border-border"
    >
      <ResizablePanel defaultSize={35} minSize={20} collapsible>
        <div className="flex h-full items-center justify-center p-4 text-sm font-medium">
          {leftTitle}
        </div>
      </ResizablePanel>
      <ResizableHandle withHandle />
      <ResizablePanel defaultSize={65} minSize={30}>
        <div className="flex h-full items-center justify-center p-4 text-sm text-muted-foreground">
          {rightTitle}
        </div>
      </ResizablePanel>
    </ResizablePanelGroup>
  );
}

API Reference

ResizablePanelGroup

Manages panel ratios, snap collapse thresholds, spring resets, and onLayout callbacks.

PropTypeDefaultDescription
direction / speed"horizontal" | "vertical" / number"horizontal" / 1Panel arrangement axis and spring playback speed multiplier.
snapCollapseThreshold / onLayoutnumber / (sizes: readonly number[]) => void4Percent margin near minSize that snaps a collapsible panel shut on release.

ResizablePanel

Percent-sized panel supporting minSize, maxSize, collapsible, collapsedSize, and collapse callbacks.

PropTypeDefaultDescription
minSize / maxSizenumber / number10 / 100Percentage bounds enforced during drag and keyboard resizing.
collapsible / collapsedSizeboolean / numberfalse / 0Allows snapping to collapsedSize when dragged past minSize or toggled with Enter.
onResize / onCollapse / onExpandcallbacks-Fired when the panel percentage changes or crosses the collapsed boundary.

ResizableHandle

Focusable WAI-ARIA separator with perpendicular aria-orientation, spring hover/drag thickness, double-click reset, and arrow key nudges.

PropTypeDefaultDescription
withHandle / disabledboolean / booleanfalse / falseRenders the centered grip pill or disables pointer and keyboard resizing.

Notes

Kinetic Resizable replaces react-resizable-panels with native flex-basis percentages, SPRING.snappy hover thickness, snap collapse, and double-click spring reset.