Skip to content

Commit

Permalink
0.0.2 -> 0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Dec 23, 2022
1 parent 8608c27 commit cebd3a0
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 52 deletions.
54 changes: 4 additions & 50 deletions README.md
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)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

## 0.0.3
* [#3](https://github.com/bvaughn/react-resizable-panels/issues/3): `Panel` visibility can be toggled on/off. `PanelGroup` will persist separate layouts for each combination of visible panels.
* [#3](https://github.com/bvaughn/react-resizable-panels/issues/3): `Panel`s can be conditionally rendered within a group. `PanelGroup` will persist separate layouts for each combination of visible panels.

## 0.0.2
* Documentation-only update.
Expand Down
50 changes: 50 additions & 0 deletions packages/react-resizable-panels/README.md
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
2 changes: 1 addition & 1 deletion packages/react-resizable-panels/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-resizable-panels",
"version": "0.0.2",
"version": "0.0.3",
"description": "React components for resizable panel groups/layouts",
"author": "Brian Vaughn <brian.david.vaughn@gmail.com>",
"license": "MIT",
Expand Down

1 comment on commit cebd3a0

@vercel
Copy link

@vercel vercel bot commented on cebd3a0 Dec 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.