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

@devbookhq/splitter

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devbookhq/splitter

Create resizable split views - like in VS Code

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.1K
decreased by-43.12%
Maintainers
2
Weekly downloads
 
Created
Source

Splitter

Splitter is a React component thath allows you to split views into resizable panels. Similar to tabs in Visual Studio Code, for example. It's used in Devbook - A Search Engine for Developers.

Here's a gif of what you can build with Splitter:

Splitter is inspired by Split.js and written as 100% functional component:

  • All size calculation is done through CSS using calc
  • Fully responsive
  • No dependencies beside React
  • Minimal assumptions about your styling and views

Installing

npm install @devbookhq/splitter
# or
yarn add @devbookhq/splitter

Usage

Horizontal split

import ReactSplit, { SplitDirection } from '@devbookhq/splitter'

function MyComponent() {
  return (
    <ReactSplit direction={SplitDirection.Horizontal}>
      <div>Tile 1</div>
      <div>Tile 2</div>
    </ReactSplit>
  );
}

Vertical split

import ReactSplit, { SplitDirection } from '@devbookhq/splitter'

function MyComponent() {
  return (
    <ReactSplit direction={SplitDirection.Vertical}>
      <div>Tile 1</div>
      <div>Tile 2</div>
    </ReactSplit>
  );
}

Nested split

import ReactSplit, { SplitDirection } from '@devbookhq/splitter'

function MyComponent() {
  return (
    <ReactSplit direction={SplitDirection.Vertical}>
      <div>Tile 1</div>
      <ReactSplit direction={SplitDirection.Horizontal}>
        <div>Tile 2</div>
        <ReactSplit direction={SplitDirection.Vertical}>
          <div>Tile 3</div>
          <div>Tile 4</div>
        </ReactSplit>
      </ReactSplit>
    </ReactSplit>
  );
}

To see more examples check out the examples section.

Examples

Check the example folder or the CodeSandbox project.

Keywords

FAQs

Package last updated on 05 Mar 2021

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