0.0.3 • Published 3 years ago

react-split-viewport v0.0.3

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

react-split-viewport

It splits view in half

NPM JavaScript Style Guide

Install

npm install --save react-split-viewport

Usage

import React from 'react';
import { SplitView } from 'react-split-viewport';

const App = () => (
	<SplitView
	  initWidth={45}
    range={{
      min: 25,
      max: 75
    }}
    left=<div>Left</div>
    right=<div>Right</div>
	/>
);

export default App;

Props

NameDescriptionDefaultValue
initWidthInitial width of the right side.(Initial left side will be calculated with respect to this value)50number
leftContent for left sideLeftelement
rightContent for right sideRightelement
rangeMinimum and maximum adjustment levels{ min: 25, max: 75 }{ min: number, max: number }
onResizeResize callbacknullfunc
resizePropsStyle property for resize bar{ bgColor: '#322f3d', width: 10, height: { val: 100, unit: '%' } }{ bgColor: string, width: number, height: { val: number, unit: string } }
resizeHandlerPropsStyle property for resize handler{ markup: , position: { x: 50, y: 50, unit: '%' } }{ markup: element, position: { x: number, y: number, unit: string } }
showSwitcherSwitcher visibilitytruebool
onSwitchClickSwitch click callbacknullfunc
switcherPropsStyle property for switch button{ markup: , position: { x: 10, y: 10, unit: 'px' } }{ markup: element, position: { x: number, y: number, unit: string } }

License

MIT © mertNalcaci

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago