luna-split-pane
TypeScript icon, indicating that this package has built-in type declarations

0.2.5 • Public • Published

Luna Split Pane

A component for creating resizable split panes.

Demo

https://luna.liriliri.io/?path=/story/split-pane

Install

Add the following script and style to your page.

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-split-pane/luna-split-pane.css" />
<script src="//cdn.jsdelivr.net/npm/luna-split-pane/luna-split-pane.js"></script>

You can also get it on npm.

npm install luna-split-pane --save
import 'luna-split-pane/luna-split-pane.css'
import LunaSplitPane from 'luna-split-pane'

Usage

const splitPane = new SplitPane(container, {
  direction: 'horizontal', // or 'vertical',
})
splitPane.append(document.createElement('div'), {
  minSize: 100,
  weight: 50,
})

Configuration

  • direction('vertical' | 'horizontal'): Direction to split.

Api

append(el: HTMLElement, options?: IElOptions): void

Append an element.

update(el: HTMLElement, options: IElOptions): void

Update an element's options.

Readme

Keywords

Package Sidebar

Install

npm i luna-split-pane

Weekly Downloads

53

Version

0.2.5

License

MIT

Unpacked Size

268 kB

Total Files

26

Last publish

Collaborators

  • surunzi