Splitter component for React, written in TypeScript
npm install m-react-splittersv. 1.2.0
New version changes
* fixed issue
v. 1.1.0
New version changes
* fixed issue with getBoundingClientRect in React 16
Install: npm install --save m-react-splitters
---------
Splitters for React has been written in TypeScript.
This splitter supports touch screens.
There are two options how the splitter can work.
You can either select to resize splitters as you are holding and dragging the handlebar, or you can
postponed the resize.
Splitters can be nested, but you have to specify what positions (vertical / horizontal) are they going to be and their sizes.
Left pane's (primary) width is calculated by JavaScript, the other panel's width is set by CSS.
Usage in your projects:
Please import splitters like this:
```
import Splitter from 'm-react-splitters';
import 'm-react-splitters/lib/splitters.css';
Vertical splitter
`js`
primaryPaneMinWidth={number}
primaryPaneMaxWidth="string" (% or px)
primaryPaneWidth="string" (% or px)
Vertical splitter
`js`
primaryPaneMinWidth={number}
primaryPaneMaxWidth="string" (% or px)
primaryPaneWidth="string" (% or px)
Horizontal splitter
`js`
primaryPaneMinHeight={number}
primaryPaneMaxHeight="string" (% or px)
primaryPaneHeight="string" (% or px)
Another options for splitter are:
* postPoned: Boolean
* this specifies how the resize will work
* default is false
* className: string primaryPaneClassName
* : stringsecondaryPaneClassName
* : stringdispatchResize
* : Boolean
* This dispatch resize event, it is meant for other components which resize on window resize
* it's something like temporary callback function
* Default is false
* or you can use:
onDragFinished: function
* maximizedPrimaryPane: BooleanminimalizedPrimaryPane
* : Boolean
`tsx``
primaryPaneMaxHeight="80%"
primaryPaneMinHeight={0}
primaryPaneHeight="400px"
dispatchResize={true}
postPoned={true}
>
primaryPaneMaxWidth="80%"
primaryPaneMinWidth={0}
primaryPaneWidth="400px"
postPoned={false}
>