Installations
npm install @geoffcox/react-splitter
Score
61.6
Supply Chain
92.6
Quality
75.2
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Developer
GeoffCox
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
Yes
Node Version
16.15.1
NPM Version
9.3.0
Statistics
51 Stars
47 Commits
14 Forks
4 Watching
3 Branches
2 Contributors
Updated on 14 Aug 2024
Languages
TypeScript (59.81%)
CSS (22.26%)
JavaScript (17.93%)
Total Downloads
Cumulative downloads
Total Downloads
270,062
Last day
21.1%
517
Compared to previous day
Last week
9.8%
2,632
Compared to previous week
Last month
0.5%
11,583
Compared to previous month
Last year
115%
119,233
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
@geoffcox/react-splitter
A resizable splitter for React that leverages CSS display:grid
Features
- Vertical (left|right) and Horizontal (top/bottom) splitting
- Set initial split size
- Reset to initial split with double-click
- Minimum pane sizes
- Sizes can be any CSS unit (e.g. px, %, fr, em, pt, cm, mm)
- Nested splits with correct resizing
- Customize the splitter size, colors, or render it yourself.
Technology
- This splitter is built using React and Typescript.
- CSS grid combined with a simple percentage split system provides accurate and responsive resizing.
- Styled components provide high performance using dynamic styles.
Installation and Usage
Known limitations
These are several limitations of the current release.
- No keyboard control of splitter. The splitter can only be controlled with the mouse.
- Resizing is immediate as the user drags the splitter. The resize may need to be debounced to correct visual update performance problems.
- No callbacks for monitoring the split or pane resizing. For now, a workaround is to use something like react-measure to wrap children and observe sizing changes.
If you overcome these limitations in your own code, pull requests are appreciated. :-)
Change History
1.0.0 - First project publication
1.0.1 - Bug fixes
- CSS was incorrect on the splitter preventing hover state
- Peer dependencies should not have included styled-components nor react-measure as npm no longer auto-installs peer dependencies.
1.0.2 - Bug fixes
- Rollup config was incorrect causing 1.0.1 to not be published correctly.
1.0.3 - Measurement reaction bug fix
- Resize of split was not reacting to overall area decreasing where the splitter gets hidden
1.0.4 - Custom splitter rendering
- Added optional splitterWidth/splitterHeight to props to allow caller to control splitter size
- Added option renderSplitter function to allow caller to render a custom splitter
- Updated default splitter to be thin line with same 5px hit area
- Updated demo to optionally show custom rendered splitter
- Fixed bug with cursor on top/bottom splitter
2.0.0 - Overhauled
- Collapsed LeftRightSplit and TopBottomSplit into a single Split component
- Leveraged minmax to remove the need for any complex math
- Changed mouse events to pointer events for improved responsiveness
- Fixed issues with dragging when browser is zoomed in
- Added support for rest on double-click
- Added support for default splitter colors
- Passed key properties to splitter render props
- Improved default splitter layout
- Added customization control to the demo
- Moved default splitter to separate module
2.0.1 - Reduced size
- Removed map files from distribution
2.0.2 - Provided events
- Added onSplitChanged to provide the primarySize as the splitter changes.
- Added onMeasuredSizesChanged to provide content, left pane, splitter, and right pane pixels sizes as the splitter changes.
2.0.3 - Bug fixes
- Export RenderSplitterProps from package
- Export DefaultSplitter from package
2.1.0 - Remove styled-components dependency
- Updated the Split and DefaultSplitter React components to use CSS variables rather than take a dependency on styled-components
- Switched from rollup to webpack to support CSS-in-JS without requiring styled-components
- Updated all HTML elements in Split with semantic class names.
2.1.1 - Fix issue with horizontal prop changes
- Thanks to Quang Ngo for finding this issue and following up with me to get it fixed!
- Updated Split to track dimensions and properly update if the horizontal prop changes.
- Removed debounce. Since moving to CSS and CSS vars, it is no longer neccessary.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
8 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
Reason
Found 1/19 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 14 are checked with a SAST tool
Score
2
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to @geoffcox/react-splitter
graphemer
A JavaScript library that breaks strings into their individual user-perceived characters (including emojis!)
react-splitter-layout
A simple split layout for React and modern browsers
@zendeskgarden/container-splitter
Containers relating to Splitter in the Garden Design System
@zag-js/splitter
Core logic for the splitter widget implemented as a state machine