Giter VIP home page Giter VIP logo

vue-split-view's Introduction

SplitView Latest version Monthly downloads Install size Bundle size

Create a resizable split-view to partition the UI.

๐Ÿ‘‰ CodePen Demo

๐Ÿš€ Install

npm i vue-split-view

๐Ÿšฆ Quick Setup

Bundler

Vue.js 3

import VueSplitView from 'vue-split-view'

Vue.js 2

import VueSplitView from 'vue-split-view/dist/vue2'

Browser

  • Load the CSS stylesheet: vue-split-view/dist/style.css

ESM

import VueSplitView from 'vue-split-view/dist/vue3.esm.js'

UMD

vue-split-view/dist/vue3.umd.js

๐Ÿ‘จ๐Ÿปโ€๐Ÿซ Examples

Horizontal split

<split-view>
	<template #A>
		Slot A
	</template>

	<template #B>
		Slot B
	</template>
</split-view>

Vertical split

<split-view direction="vertical">
	<template #A>
		Slot A
	</template>

	<template #B>
		Slot B
	</template>
</split-view>

Minimum width / height

<split-view
	direction="horizontal"
	a-init="100px"
	a-min="50px"
	a-max="200px"
>
	<template #A>
		Slot A
	</template>

	<template #B>
		Slot B
	</template>
</split-view>

Nesting split-views

<split-view direction="horizontal">
	<template #A>
		Slot A
	</template>

	<template #B>
		<split-view direction="vertical">
			<template #A>
				Slot BA
			</template>

			<template #B>
				Slot BB
			</template>
		</split-view>
	</template>
</split-view>

๐ŸŽ› API

Props

direction

Type: String

Default: horizontal

The direction the split-view should be partitioned in. Possible values are: horizontal, vertical.

a-init

Type: String

Default: none

The initial width/height of the first partition. The second partition fills the remaining width/height. Numeric values translate to pixels, string values are directly used for the width/height CSS property.

a-min

Type: String

Default: none

The minimum width/height of the first partition. This influences the second partition's maximum width/height. The value is directly used for the min-width/min-height CSS property.

a-max

Type: String

Default: none

The maxium width/height of the first partition. This influences the second partition's minimum width/height. The value is directly used for the max-width/max-height CSS property.

Slots

A

Content of the first partition.

B

Content of the second partition.

vue-split-view's People

Contributors

privatenumber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.