-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,6 @@ | ||
# react-resizable-panels | ||
React components for resizable panel groups/layouts | ||
React components for resizable panel groups/layouts. | ||
|
||
[Try a demo on Code Sandbox](https://codesandbox.io/s/react-panel-group-demo-ts9xqk) | ||
|
||
```jsx | ||
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels"; | ||
|
||
<PanelGroup autoSaveId="horizontal-panel" direction="horizontal"> | ||
<Panel defaultSize={0.3} id="sources-explorer-panel"> | ||
<SourcesExplorer /> | ||
</Panel> | ||
<Panel defaultSize={0.5} id="source-viewer-panel"> | ||
<PanelResizeHandle panelBefore="sources-explorer-panel" panelAfter="source-viewer-panel" /> | ||
<SourceViewer /> | ||
<PanelResizeHandle panelBefore="source-viewer-panel" panelAfter="console-panel" /> | ||
</Panel> | ||
<Panel defaultSize={0.2} id="console-panel"> | ||
<Console /> | ||
</Panel> | ||
</PanelGroup> | ||
``` | ||
|
||
## Props | ||
|
||
### `PanelGroup` | ||
| prop | type | description | ||
| :----------- | :-------------------------- | :--- | ||
| `autoSaveId` | `?string` | Unique id used to auto-save group arrangement via `localStorage` | ||
| `children` | `ReactNode[]` | Arbitrary React element(s) | ||
| `className` | `?string` | Class name | ||
| `direction` | `"horizontal" \| "vertical"` | Group orientation | ||
| `height` | `number` | Height of group (in pixels) | ||
| `width` | `number` | Width of group (in pixels) | ||
|
||
### `Panel` | ||
| prop | type | description | ||
| :------------ | :---------- | :--- | ||
| `children` | `ReactNode` | Arbitrary React element(s) | ||
| `className` | `?string` | Class name | ||
| `defaultSize` | `?number` | Initial size of panel (relative to other panels within the group) | ||
| `id` | `string` | Panel id (must be unique within the current group) | ||
| `minSize` | `?number` | Minum allowable size of panel (0.0 - 1.0) | ||
|
||
### `PanelResizeHandle` | ||
| prop | type | description | ||
| :------------ | :----------- | :--- | ||
| `children` | `?ReactNode` | Custom drag UI; can be any arbitrary React element(s) | ||
| `className` | `?string` | Class name | ||
| `disabled` | `?boolean` | Disable drag handle | ||
| `panelAfter` | `string` | Id of panel after (below or to the right of) the drag handle | ||
| `panelBefore` | `string` | Id of panel before (above or to the left of) the drag handle | ||
* [View the website](https://react-resizable-panels.vercel.app/) | ||
* [Read the documentation](https://github.com/bvaughn/react-resizable-panels/tree/main/packages/react-resizable-panels) | ||
* [Try it on Code Sandbox](https://codesandbox.io/s/react-resizable-panels-zf7hwd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# react-resizable-panels | ||
React components for resizable panel groups/layouts | ||
|
||
```jsx | ||
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels"; | ||
|
||
<PanelGroup autoSaveId="horizontal-panel" direction="horizontal"> | ||
<Panel defaultSize={0.3} id="sources-explorer-panel"> | ||
<SourcesExplorer /> | ||
</Panel> | ||
<Panel defaultSize={0.5} id="source-viewer-panel"> | ||
<PanelResizeHandle panelBefore="sources-explorer-panel" panelAfter="source-viewer-panel" /> | ||
<SourceViewer /> | ||
<PanelResizeHandle panelBefore="source-viewer-panel" panelAfter="console-panel" /> | ||
</Panel> | ||
<Panel defaultSize={0.2} id="console-panel"> | ||
<Console /> | ||
</Panel> | ||
</PanelGroup> | ||
``` | ||
|
||
## Props | ||
|
||
### `PanelGroup` | ||
| prop | type | description | ||
| :----------- | :-------------------------- | :--- | ||
| `autoSaveId` | `?string` | Unique id used to auto-save group arrangement via `localStorage` | ||
| `children` | `ReactNode[]` | Arbitrary React element(s) | ||
| `className` | `?string` | Class name | ||
| `direction` | `"horizontal" \| "vertical"` | Group orientation | ||
| `height` | `number` | Height of group (in pixels) | ||
| `width` | `number` | Width of group (in pixels) | ||
|
||
### `Panel` | ||
| prop | type | description | ||
| :------------ | :---------- | :--- | ||
| `children` | `ReactNode` | Arbitrary React element(s) | ||
| `className` | `?string` | Class name | ||
| `defaultSize` | `?number` | Initial size of panel (relative to other panels within the group) | ||
| `id` | `string` | Panel id (must be unique within the current group) | ||
| `minSize` | `?number` | Minum allowable size of panel (0.0 - 1.0) | ||
|
||
### `PanelResizeHandle` | ||
| prop | type | description | ||
| :------------ | :----------- | :--- | ||
| `children` | `?ReactNode` | Custom drag UI; can be any arbitrary React element(s) | ||
| `className` | `?string` | Class name | ||
| `disabled` | `?boolean` | Disable drag handle | ||
| `panelAfter` | `string` | Id of panel after (below or to the right of) the drag handle | ||
| `panelBefore` | `string` | Id of panel before (above or to the left of) the drag handle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cebd3a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-resizable-panels – ./
react-resizable-panels-git-main-bvaughn.vercel.app
react-resizable-panels.vercel.app
react-resizable-panels-bvaughn.vercel.app