Skip to content
v0.2.10

ResizablePanels

Two panels separated by an accessible pointer and keyboard resize control.

Preview
Navigation
Workspace

Use ResizablePanels

ResizablePanels is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
resizable-panels.tsxTSX
"use client";

import { FloodRoot, ResizablePanels, Text } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <ResizablePanels label="Resize workspace" main={<Text>Navigation</Text>} secondary={<Text>Workspace</Text>} style={{height:"16rem"}} />
    </FloodRoot>
  );
}

Design notes

  • Percentages describe the main pane and exclude the dedicated separator track. The host supplies content and scrolling.
  • Drag the separator or use logical arrow keys, Home/End and Shift for large steps. Horizontal resizing follows RTL direction.
  • value/onValueChange keeps the host in control. onValueCommit reports an accepted completed interaction; pointer cancellation restores the initial uncontrolled size.
  • The separator occupies space so its touch area does not overlap panel content. Persisting layout and larger panel graphs belong to the host. Introduced in 0.2.7.

API reference

PropValuesDefault
labelstringRequired
mainReactNodeRequired
secondaryReactNodeRequired
orientation"horizontal" | "vertical""horizontal"
valuenumber—
defaultValuenumber50
onValueChange(percent: number) => void—
onValueCommit(percent: number) => void—
minnumber10
maxnumber90
stepnumber1
largeStepnumber10
disabledboolean—
Native HTML propsOmit<HTMLAttributes<HTMLDivElement>, "children" | "defaultValue" | "onChange">Forwarded
View TypeScript source