Releases: bvaughn/react-resizable-panels
Releases Β· bvaughn/react-resizable-panels
0.0.60
0.0.59
0.0.58
- Change group layout to more thoroughly distribute resize delta to support more flexible group size configurations.
- Add data attribute support to
Panel
,PanelGroup
, andPanelResizeHandle
. - Update API documentation to reflect changed imperative API method names.
PanelOnResize
TypeScript def updated to reflect that previous size param isundefined
the first time it is called.
0.0.57
0.0.56
Support a mix of percentage and pixel based units at the Panel
level:
<Panel defaultSizePixels={100} minSizePercentage={20} maxSizePercentage={50} />
Note: Pixel units require the use of a
ResizeObserver
to validate. Percentage based units are recommended when possible.
Example migrating panels with percentage units
v55 | v56 |
---|---|
<Panel
defaultSize={25}
minSize={10}
maxSize={50}
/>
|
<Panel
defaultSizePercentage={25}
minSizePercentage={10}
maxSizePercentage={50}
/>
|
Example migrating panels with pixel units
v55 | v56 |
---|---|
<PanelGroup
direction="horizontal"
units="pixels"
>
<Panel minSize={100} maxSize={200} />
<PanelResizeHandle />
<Panel />
</PanelGroup>
|
<PanelGroup direction="horizontal">
<Panel
minSizePixels={100}
maxSizePixels={200}
/>
<PanelResizeHandle />
<Panel />
</PanelGroup>
|
For a complete list of supported properties and example usage, refer to the docs.
0.0.55
- New
units
prop added toPanelGroup
to support pixel-based panel size constraints.
This prop defaults to "percentage" but can be set to "pixels" for static, pixel based layout constraints.
This can be used to add enable pixel-based min/max and default size values, e.g.:
<PanelGroup direction="horizontal" units="pixels">
{/* Will be constrained to 100-200 pixels (assuming group is large enough to permit this) */}
<Panel minSize={100} maxSize={200} />
<PanelResizeHandle />
<Panel />
<PanelResizeHandle />
<Panel />
</PanelGroup>
Imperative API methods are also able to work with either pixels or percentages now. They default to whatever units the group has been configured to use, but can be overridden with an additional, optional parameter, e.g.
panelRef.resize(100, "pixels");
panelGroupRef.setLayout([25, 50, 25], "percentages");
// Works for getters too, e.g.
const percentage = panelRef.getSize("percentages");
const pixels = panelRef.getSize("pixels");
const layout = panelGroupRef.getLayout("pixels");