All Projects → DevbookHQ → splitter

DevbookHQ / splitter

Licence: MIT license
React component for building split views like in VS Code

Programming Languages

typescript
32286 projects
CSS
56736 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to splitter

Magick.net
The .NET library for ImageMagick
Stars: ✭ 2,071 (+490.03%)
Mutual labels:  resize
Hermite Resize
Canvas image resize/resample using Hermite filter with JavaScript.
Stars: ✭ 246 (-29.91%)
Mutual labels:  resize
multer-sharp
Streaming multer storage engine permit to resize and upload to Google Cloud Storage.
Stars: ✭ 21 (-94.02%)
Mutual labels:  resize
Vuegg
🐣 vue GUI generator
Stars: ✭ 2,056 (+485.75%)
Mutual labels:  resize
Pica
Resize image in browser with high quality and high speed
Stars: ✭ 2,900 (+726.21%)
Mutual labels:  resize
git-split-diffs
GitHub style split diffs in your terminal
Stars: ✭ 2,423 (+590.31%)
Mutual labels:  split
Mergi
go library for image programming (merge, crop, resize, watermark, animate, ease, transit)
Stars: ✭ 127 (-63.82%)
Mutual labels:  resize
react-native-component-splitter
VS Code Extension allows splitting React Native Component into Sub-Component
Stars: ✭ 33 (-90.6%)
Mutual labels:  split
Resize
Pure golang image resizing
Stars: ✭ 2,765 (+687.75%)
Mutual labels:  resize
pdf-thumbnail
npm package to create the preview of a pdf file
Stars: ✭ 23 (-93.45%)
Mutual labels:  resize
Vue3 Draggable Resizable
[Vue3 组件] 用于拖拽调整位置和大小的的组件,同时支持冲突检测,元素吸附对齐,实时参考线。
Stars: ✭ 159 (-54.7%)
Mutual labels:  resize
React Grid Layout
A draggable and resizable grid layout with responsive breakpoints, for React.
Stars: ✭ 14,732 (+4097.15%)
Mutual labels:  resize
ipx
High performance, secure and easy to use image proxy based on Sharp and libvips.
Stars: ✭ 683 (+94.59%)
Mutual labels:  resize
Gimage
A PHP library for easy image handling. 🖼
Stars: ✭ 148 (-57.83%)
Mutual labels:  resize
vue-size-provider
Declarative element size observer and provider
Stars: ✭ 55 (-84.33%)
Mutual labels:  resize
Size Sensor
🌿 1Kb DOM element size sensor which will callback when size changed.
Stars: ✭ 130 (-62.96%)
Mutual labels:  resize
angular-inviewport
A simple lightweight library for Angular with no other dependencies that detects when an element is within the browser viewport and adds a "sn-viewport-in" or "sn-viewport-out" class to the element
Stars: ✭ 72 (-79.49%)
Mutual labels:  resize
multiple-windows
This project is a chrome extension. It provide to create windows to different sizes and multiple for front-end developers.
Stars: ✭ 16 (-95.44%)
Mutual labels:  resize
log-master
split the log
Stars: ✭ 28 (-92.02%)
Mutual labels:  split
php-client
PHP SDK client for Split Software
Stars: ✭ 14 (-96.01%)
Mutual labels:  split

Splitter

Splitter is a React component that allows you to split views into resizable panels. Similar to tabs in Visual Studio Code, for example. 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 with minimal JS. This makes it much faster
  • Fully responsive
  • No dependencies beside React
  • Minimal assumptions about your styling and views

CodeSandbox project

Installing

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

Usage

Horizontal split

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

function MyComponent() {
  return (
    <Splitter>
      <div>Tile 1</div>
      <div>Tile 2</div>
    </Splitter>
  );
}

Vertical split

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

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

Nested split

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

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

Get sizes of tiles

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

function MyComponent() {
  function handleResizeStarted(gutterIdx: number) {
    console.log('Resize started!', gutterIdx);
  }
  function handleResizeFinished(gutterIdx: number, newSizes: number[]) {
    console.log('Resize finished!', gutterIdx, newSizes);
  }

  return (
    <Splitter
      direction={SplitDirection.Vertical}
      onResizeStarted={handleResizeStarted}
      onResizeFinished={handleResizeFinished}
    >
      <div>Tile 1</div>
      <div>Tile 2</div>
    </Splitter>
  );
}

To see more examples check out the examples section.

Examples

Check the example folder or the CodeSandbox project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].