- 726: Updated inline documentation to clarify size units.
- 723: Bug fix for context menu event (right click) occurring while pointer-resize is active
- 716): Meta info available to
onLayoutChangedcallback signalling whether resize event was triggered by direct user input (keyboard or mouse) useDefaultLayouthook supportsonlySaveAfterUserInteractionsoption to only save layouts when directly triggered by user interactions.
- 719): Bug fix: Calculate rem-based sizes relative to owner document (not body)
- 715): Edge case SSR bug fix for panels with
defaultSize={0}
- 712:
Separatorsupports:focus-visiblepseudo-class - 703: Fix: edge case scenarios when collapsing the last panel
- 711: Improve legacy browser support wrt global stylesheets
- 705: Add
data-separator="focus"state forSeparatorelements for more consistent custom CSS styles.
- 702: Add
disableDoubleClickprop toSeparatorto enable turning off the double-click size reset behavior.
- 699:
useDefaultLayouthook automatically migrates legacy layouts to version 4 format; see issue 605 for details on how this works.
- 698: Replace
Panelaria-disabledattribute withdata-disabled
- 696: Improved server rendering support for
defaultSizeprop
- 689: Fix edge case bug with pointer event capture
- 690: Imperative Panel API supports non-percentage sizes
- 683: Don't scroll separator when setting focus
- 678: Change default overflow styles to support shadows
- 677: Add
groupResizeBehaviorprop toPanel, enabling panels to retain their current size (pixels) size when the parentGroupis resized.
- 670: Check for undefined
adoptedStyleSheets(to better support environments like jsdom) - 671: Bug-fix: Update in-memory layout cache when group is resized by double-clicking on a separator
- Fixed a problem with project logo not displaying correctly in the README for the Firefox browser.
- 660:
Groupguards against layouts with mis-orderedPanelid keys
- 658: Imperative
PanelandGroupAPIs ignoreddisabledstatus when resizing panels; this is an explicit override of the disabled state and is required to support conditionally disabled groups. - 658:
Separatorcomponent does not set acursor: not-allowedstyle if the parentGrouphas cursors disabled.
- 657: Allow
PanelandSeparatorcomponents to be disabled
- 649: Optimization: Replace
useForceUpdatewithuseSyncExternalStoreto avoid side effect of swallowing "click" events in certain cases - 654: Bugfix Imperative
GroupmethodsetLayoutpersists layout to in-memory cache - 652: Re-enable collapsible panel bugfix after fixing another reported issue
- 651: Disabled the change to collapsible panel behavior that was originally made in 635 due to another reported regression
- 646: Re-enable the collapsible
Panelfrom 4.5.3 that was disabled in 4.5.6 - 648: Bugfix: Reset
Separatorhover-state onDocument"pointerout"
- 641: Removed
aria-orientationrole from rootGroupelement as this was invalid according to the ARIA spec; (for more information see the discussion on issue #640) - 642: Bugfix: Fix collapsible
Panelregression introduced in 4.5.3
- 638:
Panelavoids unnecessary re-renders in response to mouse-hover state.
- 635: Expand pre-collapsed panels if drug past the halfway point for more consistent collapse/expand behavior.
- 631: Bugfix: Panels set
max-widthandmax-heightto 100% to fix potential CSS overflow bug.
- 626: Decrease default hit target size for
SeparatorandPaneledges; make configurable via a newGroupprop.
- 624: Bugfix: Fallback to alternate CSS cursor styles for Safari
| Safari | Chrome, Firefox |
|---|---|
grab |
move |
col-resize |
ew-resize |
row-resize |
ns-resize |
- 616: Replace
SeparatorandPaneledge hit-area padding with a minimum size threshold based on Apple's user interface guidelines. Separators that are large enough will no longer be padded; separators that are too small (or panels without separators) will more or less function like before. This should not have much of a user-facing impact other than an increase in the click target area. (Previously I was not padding enough, as per Apple's guidelines.) - 615, 620: Double-clicking on a
Separatorresets its associatedPanelto its default-size (see video below); double-click will have no impact on panels without default sizes - 622: Bugfix: Panels within vertical groups are now properly sized in Safari
- 618: Bugfix: Don't override
adoptedStyleSheets
Demo of double-clicking on a separator:
dbl-click.mov
- 610: Fix calculated cursor style when
"pointermove"event is has low-precision/roundedclientXandclientYvalues
- 600: Bugfix: Collapsible
Panelshould treatdefaultSize={0}as collapsed on mount
- 599: Add new
onLayoutChangedprop toGroup.
For layout changes caused by pointer events, this method is not called until the pointer has been released. This callback should be used if you're doing something like saving a layout as it is called less frequently than the previous approach.
The useDefaultLayout hook has also been updated to use this callback (though it will continue to support the old callback as well, with a @deprecation tag).
- 595: Don't call
event.preventDefault()on "pointerup" unless a handle was actively dragged
Note
This change also fixes a text selection bug that impacted Windows users (#574)
- Moved
flex-growPanelstyle to an inline value instead of a CSS variable defined on the parentGroupto improve rendering performance. (This significantly reduces the negative impact from forced-reflow)
- 588: Replace
"unset"styles with safer override values - 589: Use capture phase for
"pointerdown"and"pointerup"events; this is necessary for compatibility with certain UI libraries like Blueprint JS - 590: Read
Panelpixel size usingoffsetWidth/offsetHeightrather thaninlineSizeto avoid an edgecase bug withResizeObserver
- 583:
Groupcomponent now sets defaultwidth,height, andoverflowstyles; (both can be overridden using thestyleproperty) - 582: Drag interactions only call
event.preventDefaultfor the primary button - Refine TS types for
useGroupRefandusePanelRefto include| nullto increase compatibility with older React versions - Update TSDoc comments for
PanelandSeparatorcomponents
useDefaultLayouthook initializesstorageparam tolocalStorageif undefined.- Fix ambiguous type for
PanelproponResizethat impacted certain TypeScript versions.
- 2a6b03f: Add
displayNameproperty toGroup,Panel, andSeparatorcomponents for better debugging experience. - 577:
Grouphandles newly registeredPanels+Separatorsduring mount so that user code can safely call imperative APIs earlier
- 573: Add
prevPanelSizeparam toonResizecallback to help simplify collapse/expand detection.
- 571: Update TS types to better reflect that
SeparatorattributesroleandtabIndexcannot be overridden using props.
- 567:
useDefaultLayouthook supports saving and restoring multiple Panel layouts - 568: Fix race in
useGroupRefandusePanelRefhooks
- 563: Panel
expand()API should restore pre-collapse size - 564: Add guard for unexpected
defaultViewvalue seemingly returned by some dev environments
- 556: Ignore
defaultLayoutwhen keys don't match Panel ids
- 555: Allow resizable panels to be rendered into a different Window (e.g. popup or frame) by accessing globals through
element.ownerDocument.defaultView
useDefaultLayout: DeprecatedgroupIdparam in favor ofidto avoid confusion; (there is no actual requirement for the Group to have a matching id)
- 552:
useDefaultLayoutnow debounces calls tostorage.setItemby 150ms
// To opt out of this change
useDefaultLayout({
debounceSaveMs: 0,
groupId: "test-group-id",
storage: localStorage,
})Note
Some may consider this a breaking change, considering the default value is 150ms rather than 0ms. I think in practice this should only impact unit tests which can be easily fixed by overriding the default (as shown above) or by using fake timers.
Changes like this are often judgement calls, but I think on balance it's better to correct my initial oversight of not debouncing this by default.
- 8604491: Fix edge case bug with panel constraints not being properly invalidated after resize
- #551: Expand fixed-size element support
- #542: Clicks on higher
z-indexelements (e.g. modals) should not trigger separators behind them - #547: Don't re-mount Group when
defaultLayoutordisableCursorprops change - #548: Bugfix: Gracefully handle
Panelid changes - #549: Improve DevX when Group within hidden DOM subtree; defer layout-change events
- #541: Don't set invalid layouts when Group is hidden or has a width/height of 0
- 40d4356: Gracefully handle invalid
defaultLayoutvalue
- f07bf00: Reset
pointer-eventstyles after "pointerup" event
- 0796644: Account for Flex gap when calculating pointer-move delta %
- #535: Updated docs to make size and layout formats clearer
- Fixed TS type for
defaultLayoutvalue returned fromuseDefaultLayout
- Export
GroupImperativeHandleandPanelImperativeHandletypes.
- #530: Edge case bug fix: Account for pointer resize events near edge of window/iframe
Version 4 of react-resizable-panels offers more flexible size constraints– supporting units as pixels, percentages, REMs/EMs, and more. Support for server-rendering (including Server Components) has also been expanded.
Refer to the docs for a complete list of props and API methods. Below are some examples of migrating from version 3 to 4, but first a couple of potential questions:
- Q: Why'd you rename <component> or <prop>?
- A: The most likely reason is that I think the new name more closely aligns with web standards like WAI-ARIA and CSS. For example, the
PanelResizeHandlecomponent was renamed toSeparatorto better align with the ARIA "separator" role and thedirectionprop was renamed toorientationto better align with the ARIAorientationattribute . - Q: Why'd you remove support for <feature>?
- A: Probably because it wasn't used widely enough to justify the complexity required to maintain it. If it turns out that I'm mistaken, features can always be (re)added but it's more difficult to remove them.
- Q: Were the
onCollapseandonExpandevent handlers removed? - A: Yes. Use the
onResizeevent handler instead:onResize={(nextSize, id, prevSize) => { if (prevSize !== undefined) { const wasCollapsed = prevSize.asPercentage !== 0; const isCollapsed = nextSize.asPercentage === 0; if (isCollapsed !== wasCollapsed) { // Panel was collapsed or expanded } } }}
// Version 3
import { PanelGroup, Panel, PanelResizeHandle } from "react-resizable-panels";
<PanelGroup direction="horizontal">
<Panel defaultSize={30} minSize={20}>left</Panel>
<PanelResizeHandle />
<Panel defaultSize={30} minSize={20}>right</Panel>
</PanelGroup>
// Version 4
import { Group, Panel, Separator } from "react-resizable-panels";
<Group orientation="horizontal">
<Panel defaultSize="30%" minSize="20%">left</Panel>
<Separator />
<Panel defaultSize="30%" minSize="20%">right</Panel>
</Group>// Version 3
import { PanelGroup, Panel, PanelResizeHandle } from "react-resizable-panels";
<PanelGroup autoSaveId="unique-group-id" direction="horizontal">
<Panel>left</Panel>
<PanelResizeHandle />
<Panel>right</Panel>
</PanelGroup>
// Version 4
import { Group, Panel, Separator, useDefaultLayout } from "react-resizable-panels";
const { defaultLayout, onLayoutChange } = useDefaultLayout({
groupId: "unique-group-id",
storage: localStorage
});
<Group defaultLayout={defaultLayout} onLayoutChange={onLayoutChange}>
<Panel>left</Panel>
<Separator />
<Panel>right</Panel>
</Group>Note
Refer to the docs for examples of persistent layouts with server rendering and server components.
// Version 3
import { PanelGroup, Panel, PanelResizeHandle } from "react-resizable-panels";
<PanelGroup autoSaveId="unique-group-id" direction="horizontal">
{showLeftPanel && (
<>
<Panel id="left" order={1}>left</Panel>
<PanelResizeHandle />
</>
)}
<Panel id="center" order={2}>center</Panel>
{showRightPanel && (
<>
<PanelResizeHandle />
<Panel id="right" order={3}>right</Panel>
</>
)}
</PanelGroup>
// Version 4
import { Group, Panel, Separator } from "react-resizable-panels";
<Group>
{showLeftPanel && (
<>
<Panel id="left">left</Panel>
<Separator />
</>
)}
<Panel id="center">center</Panel>
{showRightPanel && (
<>
<Separator />
<Panel id="right">right</Panel>
</>
)}
</Group>// Version 3
import { PanelGroup, Panel, PanelResizeHandle } from "react-resizable-panels";
import type { ImperativePanelGroupHandle, ImperativePanelHandle }from "react-resizable-panels";
const panelRef = useRef<ImperativePanelHandle>(null);
const panelGroupRef = useRef<ImperativePanelGroupHandle>(null);
<PanelGroup direction="horizontal" ref={panelGroupRef}>
<Panel ref={panelRef}>left</Panel>
<PanelResizeHandle />
<Panel>right</Panel>
</PanelGroup>
// Version 4
import { Group, Panel, Separator, useGroupRef, usePanelRef } from "react-resizable-panels";
const groupRef = useGroupRef();
const panelRef = usePanelRef();
<Group groupRef={groupRef} orientation="horizontal">
<Panel panelRef={panelRef}>left</Panel>
<Separator />
<Panel>right</Panel>
</Group>// Version 3
import { disableGlobalCursorStyles } from "react-resizable-panels";
disableGlobalCursorStyles();
// Version 4
import { Group, Panel, Separator } from "react-resizable-panels";
<Group disableCursor />- #517: Fixed Firefox bug that caused resizing to be interrupted unexpected
- #512: Fixed size precision regression from 2.0.17
- #503: Support custom cursors
- #492: Fix compatibility with cloudflare workers
- Fallback for type of
HTMLElementto better support portal edge cases
- #479: Improve support for Cloudflare Workers and Vercel Functions
- #480: Fixed
package.json#typesreference
- #478: Module is ESM-only in order to better work with modern tooling.
- #475:
"pointerup"and"pointercancel"listeners are now attached to theownerDocumentbody to better support edge cases like portals being rendered into a child window.
- #467: Only stop propagate for pointer events with targets that are outside of a resize handle
- #473: Replace
innerHtmlwithinsertRuleto better support Trusted Types - #471: Export typed
DATA_ATTRIBUTESobject to simplify e2e tests.
- #463: Fix
aria-controlsattribute value for auto-generated ids - #464: Fix duplicate type declarations for React
- #465: Add
onPointerDown,onPointerUp, andonClickcallbacks toPanelResizeHandleso users can implement double-click - #466: Fix bad
removeEventListenercall that caused pointer state to get broken between pages/routes
- #427: Stacking order checks also check for
SVGElements (bug fix) - #433: Exclude
srcdirectory from NPM package
- Removed
"engines"block and replaced with"packageManager" - Don't read
document.directionfor RTL detection; use inherited style instead
- Add react v19 to peer deps
- Improve TypeScript HTML tag type generics (#407)
- Edge case check to make sure resize handle hasn't been unmounted while dragging (#410)
- Edge case bug fix for a resize handle unmounting while being dragged (#402)
- Suppress invalid layout warning for empty panel groups (#396)
- Fix
onDraggingregression (#391) - Fix cursor icon behavior in nested panels (#390)
- Add opt-in support for setting the
"nonce"attribute for the global cursor style (#386) - Support disabling global cursor styles (#387)
- Improve obfuscation for
React.useIdreferences (#382)
- Force eager layout re-calculation after panel added/removed (#375)
- Handle pointer event edge case with different origin iframes (#374)
- Reset global cursor if an active resize handle is unmounted (#313)
- Resize handle supports (optional)
onFocusoronBlurprops (#370)
- Add optional
minSizeoverride param to panelexpandimperative API
- Inline object
hitAreaMarginswill not trigger re-initialization logic unless inner values change (#342)
- Prevent pointer events handled by resize handles from triggering elements behind/underneath (#338)
- Replaced .toPrecision() with .toFixed() to avoid undesirable layout shift (#323)
- Better account for high-precision sizes with
onCollapseandonExpandcallbacks (#325)
- Better account for high-precision
collapsedSizevalues (#325)
- Fix potential cycle in stacking-order logic for an unmounted node (#317)
- Improve resize for edge cases with collapsed panels; intermediate resize states should now fall back to the most recent valid layout rather than the initial layout (#311)
- Fix resize handle cursor hit detection when when viewport is scrolled (#305)
- Fix conditional layout edge case (#309)
- Fix Flex stacking context bug (#301)
- Fix case where pointer event listeners were sometimes added to the document unnecessarily
Panel/PanelGroup/`PanelResizeHandle`` pass "id" prop through to DOM (#299)Panelattributesdata-panel-collapsibleanddata-panel-sizeare no longer DEV-only (#297)
- Group default layouts use
toPrecisionto avoid small layout shifts due to floating point precision differences between initial server rendering and client hydration (#295)
- Replace
useLayoutEffectusage with SSR-safe wrapper hook (#294)
- Resize handle hit detection considers stacking context when determining hit detection (#291)
- Fixed
PanelResizeHandleonDraggingprop to only be called for the handle being dragged (#289)
- Fix resize handle onDragging callback (#278)
- Fixed an issue where size might not be re-initialized correctly after a panel was hidden by the
unstable_Activity(previously "Offscreen") API.
- Fixed a regression introduced in 2.0.0 that caused React
onClickandonMouseUphandlers not to fire.
- Support resizing multiple (intersecting) panels at once (#274)
This behavior can be customized using a new
hitAreaMarginsprop; defaults to a 15 pixel margin for coarse inputs and a 5 pixel margin for fine inputs.
- Fixed edge case constraints check bug that could cause a collapsed panel to re-expand unnecessarily (#273)
- DOM util methods scope param defaults to
document(#262) - Updating a
Panel's pixel constraints will trigger revalidation of thePanel's size (#266)
- Update component signature to declare
ReactElementreturn type (rather thanReactNode) (#256) - Update
Paneldev warning to avoid warning whendefaultSize === collapsedSizefor collapsible panels (#257) - Support shadow dom by removing direct references to / dependencies on the root
document(#204)
- Narrow
tagNameprop to only allowHTMLElementnames (rather than the broaderElementtype) (#251)
- Export internal DOM helper methods.
- Fix server rendering regression (#240); Panels will now render with their
defaultSizeduring initial mount (if one is specified). This allows server-rendered components to store the most recent size in a cookie and use that value as the default for subsequent page visits.
- Edge case bug fix for
isCollapsedpanel method; previously an uninitializedcollapsedSizevalue was not being initialized to0, which causedisCollapsedto incorrectly reportfalsein some cases.
- Remember most recently expanded panel size in local storage (#234)
- Change local storage key for persisted sizes to avoid restoring pixel-based sizes (#233)
- Small bug fix to guard against saving an incorrect panel layout to local storage
- Remove support for pixel-based Panel constraints; (props like
defaultSizePercentageshould now bedefaultSize) - Replaced
dataAttributesprop with...restprop that supports all HTML attributes
- Change default (not-yet-registered) Panel flex-grow style from 0 to 1
- Edge case expand/collapse invalid size guard (#220)
- Better unstable Offscreen/Activity API.
- Better support imperative API usage from mount effects.
- Better support strict effects mode.
- Better checks not to call
onResizeoronLayoutmore than once.
- Support imperative panel API usage on-mount.
- Made PanelGroup bailout condition smarter (don't bailout for empty groups unless pixel constraints are used).
- Improved window splitter compatibility by better handling "Enter" key.
- 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.
PanelOnResizeTypeScript def updated to reflect that previous size param isundefinedthe first time it is called.
- #207: Fix DEV conditional error that broke data attributes (and selectors).
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
ResizeObserverto validate. Percentage based units are recommended when possible.
| v55 | v56 |
|---|---|
<Panel
defaultSize={25}
minSize={10}
maxSize={50}
/>
|
<Panel
defaultSizePercentage={25}
minSizePercentage={10}
maxSizePercentage={50}
/>
|
| 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.
- New
unitsprop added toPanelGroupto 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");- 172: Development warning added to
PanelGroupfor conditionally-renderedPanel(s) that don't haveidandorderprops - 156: Package exports now used to select between node (server-rendering) and browser (client-rendering) bundles
- Fix edge case race condition for
onResizecallbacks during initial mount
- 162: Add
Panel.collapsedSizeproperty to allow panels to be collapsed to custom, non-0 sizes - 161: Bug fix:
onResizeshould be called for the initialPanelsize regardless of theonLayoutprop
- 154:
onResizeandonCollapseprops are called in response toPanelGroup.setLayout - 123:
onResizecalled when number of panels in a group change due to conditional rendering
- Improved panel size validation in
PanelGroup.
- Improved development warnings and props validation checks in
PanelGroup.
- 148: Build release bundle with Preconstruct
- Mimic VS COde behavior; collapse a panel if it's smaller than half of its min-size
- SSR: Avoid accessing default storage (
localStorage) during initialization; avoid throwing error in browsers that have 3rd party cookies/storage disabled.
- SSR: Avoid layout shift by using
defaultSizeto set initialflex-growstyle - SSR: Warn if
Panelis server-rendered without adefaultSizeprop - #135: Support RTL layouts
- #142: Avoid re-registering Panel when props change; this should reduce the number of scenarios requiring the
orderprop
- Add imperative
getLayoutAPI toPanelGroup - #139: Fix edge case bug where simultaneous
localStorageupdates to multiple saved groups would drop some values
- Change cursor style from
col-resize/row-resizetoew-resize/ns-resizeto better match cursor style at edges of a panel.
- Add imperative
setLayoutAPI forPanelGroup.
- README changes
- #118: Fix import regression from 0.0.38.
- #117:
Panelcollapse behavior works better near viewport edges. - #115:
PanelResizeHandlelogic callsevent.preventDefaultfor events it handles. - #82:
useIdimport changed to avoid triggering errors with older versions of React. (Note this may have an impact on tree-shaking though it is presumed to be minimal, given the small"react"package size.)
- #94: Add
onDraggingprop toPanelResizeHandleto be notified of when dragging starts/stops.
- #96: No longer disable
pointer-eventsduring resize by default. This behavior can be re-enabled using the newly addedPanelGrouppropdisablePointerEventsDuringResize.
- #92: Change
browserslistso compiled module works with CRA 4.0.3 Babel config out of the box.
- #85: Add optional
storageprop toPanelGroupto make it easier to persist layouts somewhere other thanlocalStorage(e.g. like a Cookie). - #70: When resizing is done via mouse/touch event– some initial state is stored so that any panels that contract will also expand if drag direction is reversed.
- #86: Layout changes triggered by keyboard no longer affect the global cursor.
- Fixed small cursor regression introduced in 0.0.33.
- Collapsible
Panels will always callonCollapseon-mount regardless of their collapsed state. - Fixed regression in b5d3ec1 where arrow keys may fail to expand a collapsed panel.
- #75: Ensure
PanelandPanelGroupcallbacks are always called after mounting.
- #71: Added
getSizeandgetCollapsedto imperative API exposed byPanel. - #67, #72: Removed nullish coalescing operator (
??) because it caused problems with default create-react-app configuration. - Fix edge case when expanding a panel via imperative API that was collapsed by user drag
- #68: Reduce volume/frequency of local storage writes for
PanelGroups configured to auto-save. - Added
onLayoutprop toPanelGroupto be called when group layout changes. Note that some form of debouncing is recommended before processing these values (e.g. saving to a database).
- #58: Add imperative
collapse,expand, andresizemethods toPanel. - #64: Disable
pointer-eventsinside ofPanels during resize. This avoid edge cases like nested iframes. - #57: Improve server rendering check to include
window.document. This more closely matches React's own check and avoids false positives for environments that aliaswindowto some global object.
- #53: Avoid
useLayoutEffectwarning when server rendering. Render panels with default style offlex: 1 1 autoduring initial render.
- #4: Add
collapsibleandonCollapseprops toPanelto support auto-collapsing panels that resize beyond theirminSizevalue (similar to VS Code's panel UX).
- Reduce style re-calc from resize-in-progress cursor style.
- While a resize is active, the global cursor style now reliably overrides per-element styles (to avoid flickering if you drag over e.g. an anchor element).
- #49: Change cursor based on min/max boundaries.
- #40: Add optional
maxSizeprop toPanel. - #41: Add optional
onResizeprop toPanel. This prop can be used (along withdefaultSize) to persistence layouts somewhere externally. - #42: Don't cancel resize operations when exiting the window. Only cancel when a
"mouseup"(or"touchend") event is fired.
- Replaced the
"ew-resize"and"ns-resize"cursor style with"col-resize"and"row-resize".
- #39: Fixed regression in TypeScript defs introduced in
0.0.20
- Add
displayNametoPanel,PanelGroup,PanelGroupContext, andPanelResizeHandleto work around ParcelJS scope hoisting renaming.
- Add optional
styleandtagNameprops toPanel,PanelGroup, andPanelResizeHandleto simplify custom styling. - Add
data-panel-group-directionattribute toPanelGroupandPanelResizeHandleto simplify custom drag handle styling.
PanelandPanelGroupnow useoverflow: hiddenstyle by default to avoid potential scrollbar flickers while resizing.
- Bug fix:
Panelstyles includeflex-basis,flex-shrink, andoverflowso that their sizes are not unintentionally impacted by their content.
- Bug fix: Resize handle ARIA attributes now rendering proper min/max/now values for Window Splitter.
- Bug fix: Up/down arrows are ignored for horizontal layouts and left/right arrows are ignored for vertical layouts as per Window Splitter spec.
- #36: Removed
PanelContextin favor of addingdata-resize-handle-activeattribute to active resize handles. This attribute can be used to update the style for active handles.
- #30:
PanelGroupusesdisplay: flexrather than absolute positioning. This provides several benefits: (a) more responsive resizing for nested groups, (b) no explicitwidth/heightprops, and (c)PanelResizeHandlecomponents can now be rendered directly withinPanelGroup(rather than as children ofPanels).
- #23: Fix small regression with
autoSaveIdthat was introduced with non-deterministicuseIdids.
- #18: Support server-side rendering (e.g. Next JS) by using
useId(when available).Panelcomponents no longer require a user-providedidprop and will also fall back to usinguseIdwhen none is provided. PanelGroupcomponent now setsposition: relativestyle by default, as well as an explicitheightandwidthstyle.
- Bug fix: #19: Fix initial "jump" that could occur when dragging started.
- Bug fix: #20: Stop resize/drag operation on "contextmenu" event.
- Bug fix: #21: Disable text selection while dragging active (Firefox only)
- Drag UX change: Reversing drag after dragging past the min/max size of a panel will no longer have an effect until the pointer overlaps with the resize handle. (Thanks @davidkpiano for the suggestion!)
- Bug fix: Resize handles are no longer left in a "focused" state after a touch/mouse event.
- Corrupt build artifact. Don't use this version.
- #13:
PanelResizeHandleshould declare "separator" role and implement the recommended "Window Splitter" pattern
- #7: Support "touch" events for mobile compatibility.
- Add
PanelContextwithactiveHandleIdproperty identifying the resize handle currently being dragged (ornull). This enables more customized UI/UX when resizing is in progress.
- #5: Removed
panelBeforeandpanelAfterprops fromPanelResizeHandle.PanelGroupnow infers this based on position within the group.
- TypeScript props type fix for
PanelGroup'schildrenprop.
- #8: Added optional
orderprop toPanelto improve conditional rendering.
- #3:
Panels can be conditionally rendered within a group.PanelGroupwill persist separate layouts for each combination of visible panels.
- Documentation-only update.
- Initial release.