Skip to content

Commit

Permalink
feat: Updated docs for collapse options
Browse files Browse the repository at this point in the history
  • Loading branch information
b-zurg committed Jun 18, 2020
1 parent 4539f24 commit 30af701
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,24 @@ It's a common UX need to want to collapse the left or initial panel to give more

* `beforeToggleButton` - the element displayed as the collapse button **before** the panel is collapsed. This is a purely aesthetic component.
* `afterToggleButton` - the element displayed as the collapse button **after** the panel is collapsed. This is a purely aesthetic component.
* `overlayCss` - the css applied to a div positioned on top of the content.
* `buttonTransition` - the animation applied to the button appear/disappear. Possible options are `zoom`, `grow`, or `fade`
* `buttonTransitionTimeout` - the time (in millisecons) that the animation for the appear/disappear of the button will take place
* `collapseSize` - the size of the collapsed panel after it has been collapsed
* `collapseTransitionTimeout` - the duration within the collapse animation will take place

Here's an example using a `Button` element made with `styled-components`
Here's an example using a `Button` element imported from elsewhere.

```tsx
<SplitPane
split="vertical"
collapseOptions={{
beforeToggleButton: <Button>⬅</Button>,
afterToggleButton: <Button>➡</Button>,
overlayCss: { backgroundColor: 'rgb(0, 0, 0, 0.4)' },
timeout: 300,
transition: 'zoom',
collapseSize: 40,
overlayCss: { backgroundColor: "black" },
buttonTransition: "zoom",
collapsedSize: 50,
collapseTransitionTimeout: 350,
}}
>
<div>This is a div</div>
Expand Down

0 comments on commit 30af701

Please sign in to comment.