百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

split-pane-react

> 前端框架
开源

适用于 React.js 的可调整分割窗口。

100 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

适用于 React.js 的可调整分割窗口。

中文

split-pane-react

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.

Installing

bash
# use npm
npm install split-pane-react

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

Example Usage

javascript
import React, { useState } from 'react';
import SplitPane, { Pane } from 'split-pane-react';
import 'split-pane-react/esm/themes/default.css';

function style (color) {
  return {
    height: '100%',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: color
  };
}

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

  return (
    

        
        

        

      
    
  );
};

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[]) => void void
onDragStart This callback is invoked when a drag starts () => void void
onDragEnd This callback is invoked when a drag ends () => 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

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.

Issues· 15 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptreactreact-componentsplit-panetypescript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架