react-resizable-panels
v4.2.0
Published
React components for resizable panel groups/layouts.
Readme
react-resizable-panels
React components for resizable panel groups/layouts.
Support
If you like this project there are several ways to support it:
Installation
Begin by installing the library from NPM:
npm install react-resizable-panelsTypeScript types
TypeScript definitions are included within the published dist folder
Documentation
Documentation for this project is available at react-resizable-panels.vercel.app.
Group
A Group wraps a set of resizable Panel components. Group content can be resized horizontally or vertically.
Group elements always include the following attributes:
<div data-group data-testid="group-id-prop" id="group-id-prop">ℹ️ Test id can be used to narrow selection when unit testing.
Required props
None
Optional props
Panel
A Panel wraps resizable content and can be configured with min/max size constraints and collapsible behavior.
Panel size props can be in the following formats:
- Percentage of the parent Group (0..100)
- Pixels
- Relative font units (em, rem)
- Viewport relative units (vh, vw)
ℹ️ Numeric values are assumed to be pixels. Strings without explicit units are assumed to be percentages (0%..100%). Percentages may also be specified as strings ending with "%" (e.g. "33%") Pixels may also be specified as strings ending with the unit "px". Other units should be specified as strings ending with their CSS property units (e.g. 1rem, 50vh)
Panel elements always include the following attributes:
<div data-panel data-testid="panel-id-prop" id="panel-id-prop">ℹ️ Test id can be used to narrow selection when unit testing.
Required props
None
Optional props
Separator
Separators are not required but they are recommended as they improve keyboard accessibility.
Separators should be rendered as the direct child of a Group component.
Separator elements always include the following attributes:
<div data-separator data-testid="separator-id-prop" id="separator-id-prop" role="separator">ℹ️ Test id can be used to narrow selection when unit testing.
ℹ️ In addition to the attributes shown above, separator also renders all required WAI-ARIA properties.
Required props
None
