Socket
Book a DemoInstallSign in
Socket

react-split-pane-smart

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-split-pane-smart

React split-pane component

0.1.4
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

React Split Pane Smart

本组件基于 react-split-pane-next 1.0.6版本开发而来

解决了此组件本身有的bug以及添加了扩展性

Install

npm install react-split-pane-smart

# or if you use yarn

yarn add react-split-pane-smart

Usage

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

<SplitPane split="vertical">
  <Pane initialSize="200px">You can use a Pane component</Pane>
  <div>or you can use a plain old div</div>
  <Pane initialSize="25%" minSize="10%" maxSize="500px">
    Using a Pane allows you to specify any constraints directly
  </Pane>
</SplitPane>;

SplitPane 可选属性有:

可选属性作用属性类型默认值
onDrag拖动分割线时回调(event: React.MouseEvent) => voidundefined
resizerClassName分割线classstring‘’
resizerChildNode分割线子元素React.ReactNodenull
resizerMouseOver分割线鼠标悬浮时回调函数(event: MouseEvent) => voidundefined
onResizeEnd鼠标抬起时会触发,返回两个面板大小(value: [,number]) => voidundefined
onResizeStart鼠标在分割线按下时会触发(event: MouseEvent) => voidundefined
onChange布局发生变化时会调用(value: [number,number]) => voidundefined
className类名stringundefined
split排布方式stringvertical | horizontal
resizerSize分割线宽度:计算元素大小时会用到number1
needExactSizes是否需要返回精确的地面板大小。关闭有利于性能。[string,string]false

Pane可选属性

可选属性作用属性类型默认值
className类型stringundefined
initialSize第一次渲染时面板大小:可以是例如 ’1‘ 、'24%'`、'200px'类型的值string'0'
minSize面板最小值:类型如initialSizestringundefined
maxSize面板最大值:类型如initialSizestring'100%'
size设置面板值:类型如initialSizestringundefined
注意当同时具有size和initialSize时,优先使用size渲染面板大小

Keywords

react

FAQs

Package last updated on 17 Feb 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.