
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
@marsio/vue-split-pane
Advanced tools
A Vue 3 component for creating resizable split panes. This component allows you to easily create layouts with resizable panels, either horizontally or vertically. It supports various features such as initial size, minimum and maximum size constraints, and
A Vue 3 component for creating resizable split panes. This component allows you to easily create layouts with resizable panels, either horizontally or vertically. It supports various features such as initial size, minimum and maximum size constraints, and nested panes.
See the example and associated code in ExampleLayout
[Demo | Changelog | View Example]
This package has two major exports:
<SplitPane>
: is used to create resizable panels within a layout. It supports both vertical and horizontal splits, allowing users to adjust the size of different sections of a page.<Pane>
: is a part of the SplitPane layout system, representing an individual resizable panel. It supports both vertical and horizontal splits and allows for flexible sizing and styling.To quickly start using @marsio/vue-split-pane
, follow the steps below:
First, you need to install the package. Run the following command in your project directory:
npm install @marsio/vue-split-pane
or if you prefer using Yarn:
yarn add @marsio/vue-split-pane
or if you prefer using Pnpm:
pnpm add @marsio/vue-split-pane
In your Vue component, import @marsio/vue-split-pane
:
import SplitPane, { Pane } from '@marsio/vue-split-pane';
@marsio/vue-split-pane
Now, you can use the SplitPane
component in your Vue application
<template>
<SplitPane>
<Pane>This is a Pane</Pane>
<Pane>This is a Pane</Pane>
</SplitPane>
</template>
<script>
import SplitPane, { Pane } from '@marsio/vue-split-pane';
export default {
components: {
SplitPane,
Pane
}
}
</script>
Or Hybrid
<template>
<SplitPane split="vertical">
<Pane initialSize="200px">You can use a Pane component</Pane>
<div>or you can use a plain old div</div>
<Pane initialSize="25%" minSize="10%" maxSize="500px">Using a Pane allows you to specify any constraints directly</Pane>
</SplitPane>
</template>
<script>
import SplitPane, { Pane } from '@marsio/vue-split-pane';
export default {
components: {
SplitPane,
Pane
}
}
</script>
Or Nested
<template>
<SplitPane split="vertical">
<Pane/>
<Pane/>
<SplitPane split="horizontal">
<Pane/>
<Pane/>
<Pane/>
</SplitPane>
<Pane/>
</SplitPane>
</template>
<script>
import SplitPane, { Pane } from '@marsio/vue-split-pane';
export default {
components: {
SplitPane,
Pane
}
}
</script>
That's it! You've successfully integrated split pane functionality into your Vue application. Customize it further according to your needs.
<SplitPane>
Props:// Determines if the pane is resizable. Default is true.
allowResize: { type: Boolean, default: true },
// Size of the resizer in pixels. Default is 1.
resizerSize: {
type: Number,
default: 1
},
// Direction of the split. Can be either 'vertical' or 'horizontal'. Default is 'vertical'.
split: {
type: String as PropType<"vertical" | "horizontal">,
default: 'vertical'
},
// Step size for resizing in pixels. Default is 1.
step: { type: Number, default: 1 }
<Pane>
Props:// The index of the pane. Typically used to identify the pane in a list.
index: {
type: Number as PropType<number>
},
// Custom CSS class for the pane.
class: {
type: String as PropType<string>
},
// Direction of the split. Can be either 'vertical' or 'horizontal'.
split: {
type: String as PropType<'vertical' | 'horizontal'>
},
// Initial size of the pane. Can be a string (e.g., '50%') or a number (e.g., 200).
initialSize: {
type: [String, Number] as PropType<string | number>,
default: '1'
},
// Minimum size of the pane. Can be a string (e.g., '10%') or a number (e.g., 100px).
minSize: {
type: String as PropType<string>,
default: '0'
},
// Maximum size of the pane. Can be a string (e.g., '90%') or a number (e.g., 500px).
maxSize: {
type: String as PropType<string>,
default: '100%'
},
// Current size of the pane. Can be a string (e.g., '50%') or a number (e.g., 200).
size: {
type: String as PropType<string>
},
// Reference to the inner element of the pane. Typically used for DOM manipulation.
innerRef: {
type: Function,
default: () => () => {}
},
// Size of the resizers in pixels. Default is 1.
resizersSize: {
type: Number,
default: 1
}
![]() Edge | ![]() Firefox | ![]() Chrome | ![]() Safari | ![]() Opera |
---|---|---|---|---|
Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
Detailed changes for each release are documented in the release notes.
pnpm release
pnpm publish
MIT
[1.0.0] - (August 18, 2024)
FAQs
A Vue 3 component for creating resizable split panes. This component allows you to easily create layouts with resizable panels, either horizontally or vertically. It supports various features such as initial size, minimum and maximum size constraints, and
The npm package @marsio/vue-split-pane receives a total of 7 weekly downloads. As such, @marsio/vue-split-pane popularity was classified as not popular.
We found that @marsio/vue-split-pane demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.