@window-splitter/react

Panel

A panel within a PanelGroup

NameTypeDescription
handleRef<PanelHandle> | undefined;

Imperative handle to control the panel

onResizeOnResizeCallback | undefined;

Callback called when the panel is resized

collapsedboolean | undefined;

CONTROLLED COMPONENT

If this prop is used it will be used as the source of truth for the collapsed state. It should be used in conjunction with the onCollapseChange prop.

Use this if you want full control over the collapsed state. When trying to collapse a panel it will defer to onCollapseChange to determine if it should be collapsed.

onCollapseChange((isCollapsed: boolean) => void) | undefined

CONTROLLED COMPONENT

A callback called with the new desired collapsed state. If paired w with the collapsed prop this will be used to control the collapsed state.

Otherwise this will just be called with the new collapsed state so you can use it to update your own state.

minUnit | undefined;

The minimum size of the panel

maxUnit | undefined;

The maximum size of the panel

defaultUnit | undefined;

The default size of the panel

collapsibleboolean | undefined;

Whether the panel is collapsible

defaultCollapsedboolean | undefined;

Whether the panel should initially render as collapsed

collapsedSizeUnit | undefined;

The size of the panel once collapsed

isStaticAtRestboolean | undefined;

By default the layout will be stored in percentage values while at rest. This makes scaling the layout easier when the container is resized. However you might have a panel you want to stay at a static size when the container is resized.

collapseAnimation"ease-in-out" | "bounce" | "linear" | { duration: number; easing: "ease-in-out" | "bounce" | "linear" | ((t: number) => number); } | undefined

Animate the collapse/expand