Installations
npm install split-pane-react-fixed
Developer Guide
Typescript
No
Module System
N/A
Node Version
16.13.2
NPM Version
8.1.2
Score
54.7
Supply Chain
90
Quality
74.2
Maintenance
100
Vulnerability
99.6
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (90.4%)
JavaScript (4.79%)
SCSS (3.61%)
HTML (1.2%)
Developer
HelenTim
Download Statistics
Total Downloads
3,849
Last Day
6
Last Week
27
Last Month
118
Last Year
1,846
GitHub Statistics
16 Commits
1 Forks
1 Watching
1 Branches
1 Contributors
Bundle Size
6.95 kB
Minified
2.48 kB
Minified + Gzipped
Package Meta Information
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
Publised On
21 Feb 2023
Total Downloads
Cumulative downloads
Total Downloads
3,849
Last day
500%
6
Compared to previous day
Last week
125%
27
Compared to previous week
Last month
18%
118
Compared to previous month
Last year
-7.8%
1,846
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
split-pane-react-fixed
Resizable split panes for React.js.Check out the live demo. Different themes.
Features
- 💪Simple api and support for multiple panels.
- 🔥Supports vertical & horizontal layouts and fluid pane.
- 🎉Use controlled component mode, flexible use.
- 😎React16.8 version at least, and React18 version at the same time.
- 👷♂️Support flexible and convenient customization of sash.
reference
Installing
1# use npm 2npm install split-pane-react-fixed 3 4# or if you use yarn 5yarn add split-pane-react-fixed
Example Usage
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};
props
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 |
themes
You can use the sashRender parameter to configure the theme you need:
- The default theme style refers to vscode style
- At the same time, we have built in a theme similar to sublime
- Other demo themes.
License
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.