Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-split-pane

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-split-pane

React split-pane component

  • 0.1.92
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
144K
decreased by-23.91%
Maintainers
1
Weekly downloads
 
Created

What is react-split-pane?

The react-split-pane package allows you to create resizable split views or panes in your React applications. It is useful for creating layouts where you need to divide the screen into multiple resizable sections.

What are react-split-pane's main functionalities?

Basic Split Pane

This code demonstrates a basic vertical split pane with two sections. The user can resize the panes between a minimum size of 50px and a maximum size of 200px.

import SplitPane from 'react-split-pane';

function App() {
  return (
    <SplitPane split="vertical" minSize={50} defaultSize={100} maxSize={200}>
      <div>Pane 1</div>
      <div>Pane 2</div>
    </SplitPane>
  );
}

Nested Split Panes

This code demonstrates nested split panes. The outer split pane is vertical, and the inner split pane is horizontal, allowing for more complex layouts.

import SplitPane from 'react-split-pane';

function App() {
  return (
    <SplitPane split="vertical" minSize={50} defaultSize={100} maxSize={200}>
      <div>Pane 1</div>
      <SplitPane split="horizontal" minSize={50} defaultSize={100} maxSize={200}>
        <div>Pane 2</div>
        <div>Pane 3</div>
      </SplitPane>
    </SplitPane>
  );
}

Controlled Split Pane

This code demonstrates a controlled split pane where the size of the panes is managed by the component's state. The size can be dynamically updated based on user interaction.

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

function App() {
  const [size, setSize] = useState(100);

  return (
    <SplitPane split="vertical" size={size} onChange={setSize}>
      <div>Pane 1</div>
      <div>Pane 2</div>
    </SplitPane>
  );
}

Other packages similar to react-split-pane

Keywords

FAQs

Package last updated on 10 Aug 2020

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