🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

svelte-splitpanes

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-splitpanes

Create resizable view panels in Svelte 3, a radical new approach to building user interfaces.

0.3.0
Source
npm
Version published
Weekly downloads
3.8K
-12.38%
Maintainers
1
Weekly downloads
 
Created
Source

Svelte-Splitpanes

Create resizable view panels in Svelte 3, a radical new approach to building user interfaces.

screenshot

This library is a port from the excellent vue-splitpanes, if you are using this library for business or leasure, please consider backing the original author!

While you are at it, you may also back the developer who ported the code to Svelte. :blush:

Features

  • Size is less than 2 kb
  • Support both dynamic horizontal and vertical splits
  • Support defaults, min and max sizes
  • Support multiple splits
  • Support lifecyle events
  • Support custom divider size or overlay
  • Support splitter pane pushing
  • Support RTL rendering
  • Support first splitter on/off
  • Support pane toggle
  • Support programmatic resizing
  • Support programmatic splitter add/remove
  • Support for legacy browser such as IE 11
  • Support for touch devices

Todo

  • If some panes miss sizing defaults, calculate them
  • If the total pane sizes is > 100, prorate them

Browser Support

ChromeFirefoxSafariOperaEdgeIE
Latest ✔Latest ✔Latest ✔Latest ✔Latest ✔10+ ✔

Demo & Documentation

https://orefalo.github.io/svelte-splitpanes/

Installation

$ npm i svelte-splitpanes

Usage

<Splitpanes class="default-theme" style="height: 400px">
	<Pane minSize="20">1<br /><em class="specs">I have a min width of 20%</em></Pane>
	<Pane>
		<Splitpanes class="default-theme" horizontal="{true}">
			<Pane minSize="15">2<br /><em class="specs">I have a min height of 15%</em></Pane>
			<Pane>3</Pane>
			<Pane>4</Pane>
		</Splitpanes>
	</Pane>
	<Pane>5</Pane>
</Splitpanes>

API

Here is the list of properties that apply to

Parameter nameDefaultComments
horizontalfalse (Vertical by default)The orientation of the split panes.
pushOtherPanestrueWhether a splitter should push the next splitter when dragging.
dblClickSplittertrueDouble click on splitter to maximize the next pane
rtlfalseSupports Right to left direction
firstSplitterfalseDisplays the first splitter when set to true. This allows maximizing the first pane on splitter double click
idundefinedProvide an optional id attribute to the component for styling/other reasons

Properties that apply to

Parameter nameDefaultComments
minSize0minimum pane size in %
maxSize100maximum pane size in %
sizeundefinedpane size in %

Styling

The component can be further styled after the props have been defined by overriding the default css styling. The best way to do this is to use a class differenciator or the id="" prop and then scope your global css with this class/id.

TODO

Contributing

If you have any idea, feel free to open an issue to discuss an idea or new feature, yuo may also fork Splitpanes and submit your changes back.

npm package

# generate the package in /package
npm run package
# publish it (requires to be logged into npm from the cli)
cd package
npm publish --access public

GH Pages

# generate new site to /docs
$ npm run build-ghpages
# then commit and push changes to git, github will auto publish

FAQs

Package last updated on 06 Apr 2022

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