Documentation
More

Limitations

What React Resizable Panels has that this package does not, why, and what to do instead, plus the known gaps of the current release.

The behaviour reference of this package is React Resizable Panels (its flex groups: Group, Panel, Separator). Constraints, units, collapse thresholds, restore sizes, group resize behaviour and normalization follow it, checked by tests against it. This page lists, honestly, what it has that this package does not: some on purpose (they are app policy, or cosmetic, or another library's job), some not yet. Each comes with what to do instead.

Not yet

React Resizable Panelsherewhat to do instead
em resolves against the panel's own font size.em resolves against the group element's font size, which the engine measures once per group.Use rem, or set the font size on the group.
Extended hit targets: a minimum target size (resizeTargetMinimumSize, larger for coarse pointers), resizing from a panel's edge, and one drag moving the crossing separators of nested groups together.The separator element is the hit target; each drag moves one separator.Give the separator the hit area you want and draw a thin line inside it (see Styling with CSS); @media (pointer: coarse) can widen it on touch screens.
Numeric ids (id={1}).Ids are strings.id={String(n)}.

On purpose

React Resizable Panelsherewhy, and what to do instead
Cursor styles: a global cursor while dragging, disableCursor.No cursor at all.A cursor is cosmetic, so it is yours: cursor: col-resize from data-orientation, and on the group while data-dragging (see Styling with CSS).
Separator previews: resizePreviewMode="separator", SeparatorOverlay, a separator's preview, resizing only on release.Panels resize live, every pointer move.Out of scope for the first release. A drag's steps are transient commands, so a middleware or listener can tell a preview from the commit.
useDefaultLayout: saves and restores a layout in a storage you pass.The saved document, and defaultSize / defaultLayout for the defaults.Persistence is app policy: save model.get("splitter-json") wherever you want and restore it with createSplitterModel(json) (see Saving a layout).
Imperative handles: panelRef and groupRef (collapse, expand, resize, getSize, isCollapsed, getLayout, setLayout).Commands and keys on the model, reached with useSplitter() or an external ref.model.run("panel.collapse", { panelId }), model.get("panel-size-by", { panelId }), model.run("group.set-layout", …): one API that middleware sees and an assistant can call.
onLayoutChanged(layout, meta) with isUserInteraction.onLayoutCommit(layout).model.subscribe tells which command committed, with its meta: a drag is separator.move, a button runs what you called, and what the adapter runs for the markup carries source: "adapter".
Grid, Gridline, Cell (two-dimensional layouts) and the Workspace (tabsets).Flex groups only.Use Fragiola's Grid Layout for grids and Dockable for tabsets and docking.
Default styles it writes (a group's height: 100%, ...).Structural style only: flex sizing, overflow: hidden on panels, touch-action: none on separators.Size the group yourself (see Sizing the group).

Other things to know

  • Code can resize a disabled panel (panel.resize, panel.collapse, group.set-layout), as React Resizable Panels' imperative API can. A middleware vetoes it if your app must not.
  • Pixel units need a measure. Until the engine measured a group (on the server, in Node), only percentages resolve, and panel.resize to a pixel size is refused.
  • A direction set through CSS alone (a class that sets direction, no dir attribute) is read when the engine measures: run engine.run("measure", {}) after it. A dir attribute switched at runtime is followed (see Right-to-left).
  • Angular on the server. An Angular group registers after its first render in the browser (afterNextRender): the server HTML has the structural style, so nothing shifts, but no paths until the browser takes over. Angular server rendering has no test of its own yet.
  • Separators are matched by order, not by declaration: the n-th separator element of a group is the one after its n-th panel. Render one between each pair of panels.

Found something else? Open an issue.