New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

split-pane-ceshi

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

split-pane-ceshi

Resizable split panes for React.js.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

split-pane-react

Resizable split panes for React.js.Check out the live demo.

Features

  • Supports vertical & horizontal layouts.
  • Supports fluid pane.
  • Use controlled component mode, flexible use
  • Built in different themes

Installing

# use npm
npm install split-pane-react

# or if you use yarn
yarn add split-pane-react

Example Usage

import SplitPane, { Pane } from 'split-pane-react';

function Basic () {
    const [sizes, setSizes] = useState([
        100,
        '30%',
        'auto',
    ]);

    const layoutCSS = {
        height: '100%',
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
    };

    return (
        <div style={{ height: 500 }}>
            <SplitPane
                split='vertical'
                sizes={sizes}
                onChange={setSizes}
            >
                <pane minSize={50} maxSize='50%'>
                  <div style={{ ...layoutCSS, background: '#ddd' }}>
                    pane1
                  </div>
                </pane>
                <div style={{ ...layoutCSS, background: '#d5d7d9' }}>
                    pane2
                </div>
                <div style={{ ...layoutCSS, background: '#a1a5a9' }}>
                    pane2
                </div>
            </SplitPane>
        </div>
    );
};

props

** SplitPane **

PropertyDescriptionTypeDefault
splitDetermine layout of panes.'vertical' |'horizontal''vertical'
sizesCollection of different panel sizes,Only support controlled mode, so it's required(string | number)[][]
resizerSizeSpecify the size for resizernumber4
allowResizeShould allowed to resizedbooleantrue
classNamesplit pane custom class namestringnull
sashClassNamesaplit sash custom class namestringnull
onChangeCallback of size change(sizes: number[]) => voidnull

** Pane **

PropertyDescriptionTypeDefault
minSizeLimit the minimum size of the panelstring | numbernull
maxSizeLimit the maximum size of this panelstring|numbernull
classNamepane class namestringnull

themes

Three different theme styles are built into this component:

  • The default theme style refers to vscode style,The reference path is as follows:
import 'split-pane-react/dist/themes/default.css'
  • The style1 theme style refers to sublime style,The reference path is as follows:
import 'split-pane-react/dist/themes/theme1.css'
  • The style 2 theme has a permanent axis,The reference path is as follows:
import 'split-pane-react/dist/themes/theme2.css'

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 try my best to solve them.

Keywords

FAQs

Package last updated on 24 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc