Gathering detailed insights and metrics for split-pane-react-fixed
Gathering detailed insights and metrics for split-pane-react-fixed
Gathering detailed insights and metrics for split-pane-react-fixed
Gathering detailed insights and metrics for split-pane-react-fixed
npm install split-pane-react-fixed
Typescript
Module System
Node Version
NPM Version
TypeScript (90.4%)
JavaScript (4.79%)
SCSS (3.61%)
HTML (1.2%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
16 Commits
1 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Feb 17, 2023
Latest Version
0.2.8
Package Id
split-pane-react-fixed@0.2.8
Unpacked Size
46.31 kB
Size
13.37 kB
File Count
26
NPM Version
8.1.2
Node Version
16.13.2
Published on
Feb 21, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
Resizable split panes for React.js.Check out the live demo. Different themes.
1# use npm 2npm install split-pane-react-fixed 3 4# or if you use yarn 5yarn add split-pane-react-fixed
1import React, { useState } from 'react'; 2import SplitPane, { Pane } from 'split-pane-react-fixed'; 3import 'split-pane-react-fixed/esm/themes/default.css'; 4 5function style (color) { 6 return { 7 height: '100%', 8 display: 'flex', 9 alignItems: 'center', 10 justifyContent: 'center', 11 backgroundColor: color 12 }; 13} 14 15function App () { 16 const [sizes, setSizes] = useState([100, '30%', 'auto']); 17 18 return ( 19 <div style={{ height: 500 }}> 20 <SplitPane 21 split='vertical' 22 sizes={sizes} 23 onChange={setSizes} 24 > 25 <Pane minSize={50} maxSize='50%'> 26 <div style={style('#ddd')}> 27 pane1 28 </div> 29 </Pane> 30 <div style={style('#ccc')}> 31 pane2 32 </div> 33 <div style={style('#eee')}> 34 pane3 35 </div> 36 </SplitPane> 37 </div> 38 ); 39};
SplitPane
Property | Description | Type | Default |
---|---|---|---|
split | Determine layout of panes. | 'vertical' |'horizontal' | 'vertical' |
sizes | Collection of different panel sizes,Only support controlled mode, so it's required | (string | number)[] | [] |
resizerSize | Specify the size for resizer | number | 4 |
allowResize | Should allowed to resized | boolean | true |
className | split pane custom class name | string | void |
sashRender | User defined sliding axis function | (index: number, active: boolean) => void | void |
performanceMode | High performance mode to avoid excessive pressure on the browser | boolean | false |
onChange | Callback of size change | (sizes: number[],e:MouseEvent) => void | void |
onDragStart | This callback is invoked when a drag starts | (e:MouseEvent) => void | void |
onDragEnd | This callback is invoked when a drag ends | (e:MouseEvent) => void | void |
onSashMouseEnter | This callback is invoked when mouse in sash | (e:MouseEvent,index:number)=>void | void |
Pane
Property | Description | Type | Default |
---|---|---|---|
className | pane class name | string | void |
minSize | Limit the minimum size of the panel | string | number | void |
maxSize | Limit the maximum size of this panel | string|number | void |
primary | The size of the pane will not be changed first | boolean | false |
You can use the sashRender parameter to configure the theme you need:
split-pane-react licensed under MIT.
PS: I would love to know if you're using split-pane-react. If you have any use problems, you can raise the issue, and I will repair them as soon as possible. The project will always be maintained. If you have a good idea, you can propose a merge. If this component helps you, please leave your star. Those who need it will be very grateful.
No vulnerabilities found.
No security vulnerabilities found.