
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
vue-allotment
Advanced tools
Vue 3 port of React Allotment - resizable split views with draggable dividers
A Vue 3 port of the popular React Allotment component library. This library provides resizable split views for Vue applications, perfect for creating complex layouts with draggable dividers.
npm install vue-allotment
# or
pnpm add vue-allotment
# or
yarn add vue-allotment
<script setup>
import { Allotment, Pane } from 'vue-allotment'
import 'vue-allotment/style.css'
</script>
<template>
<Allotment>
<Pane>
<div>Left Panel</div>
</Pane>
<Pane>
<div>Right Panel</div>
</Pane>
</Allotment>
</template>
<template>
<Allotment>
<Pane min-size="{200}">
<div>Left side</div>
</Pane>
<Pane>
<div>Right side</div>
</Pane>
</Allotment>
</template>
<template>
<Allotment vertical>
<Pane>
<div>Top panel</div>
</Pane>
<Pane>
<div>Bottom panel</div>
</Pane>
</Allotment>
</template>
<template>
<Allotment :default-sizes="[200, 300, 100]">
<Pane>
<div>200px wide</div>
</Pane>
<Pane>
<div>300px wide</div>
</Pane>
<Pane>
<div>100px wide</div>
</Pane>
</Allotment>
</template>
| Prop | Type | Default | Description |
|---|---|---|---|
defaultSizes | number[] | - | Initial sizes for each pane |
vertical | boolean | false | Split direction |
separator | boolean | true | Show separator between panes |
proportionalLayout | boolean | true | Resize proportionally |
minSize | number | 30 | Global minimum pane size |
maxSize | number | Infinity | Global maximum pane size |
snap | boolean | false | Enable snapping to zero |
className | string | - | Custom CSS class |
| Prop | Type | Default | Description |
|---|---|---|---|
minSize | number | - | Minimum size for this pane |
maxSize | number | - | Maximum size for this pane |
preferredSize | number | string | - | Preferred size (px or %) |
priority | 'Normal' | 'Low' | 'High' | 'Normal' | Resize priority |
snap | boolean | false | Enable snapping for this pane |
visible | boolean | true | Pane visibility |
className | string | - | Custom CSS class |
<script setup>
function onSizeChange(sizes) {
console.log('New sizes:', sizes)
}
function onDragStart(sizes) {
console.log('Drag started with sizes:', sizes)
}
function onDragEnd(sizes) {
console.log('Drag ended with sizes:', sizes)
}
function onReset() {
console.log('Panes were reset')
}
</script>
<template>
<Allotment
@change="onSizeChange"
@drag-start="onDragStart"
@drag-end="onDragEnd"
@reset="onReset"
>
<!-- panes -->
</Allotment>
</template>
<script setup>
import { ref } from 'vue'
import { Allotment, Pane } from 'vue-allotment'
const allotmentRef = ref()
function reset() {
allotmentRef.value?.reset()
}
function resize() {
allotmentRef.value?.resize([300, 400])
}
</script>
<template>
<div>
<button @click="reset">
Reset
</button>
<button @click="resize">
Custom Resize
</button>
<Allotment ref="allotmentRef">
<Pane>Panel 1</Pane>
<Pane>Panel 2</Pane>
</Allotment>
</div>
</template>
The component uses CSS modules and provides CSS custom properties for theming:
:root {
--focus-border: #007fd4;
--separator-border: rgba(128, 128, 128, 0.35);
--sash-size: 8px;
--sash-hover-size: 4px;
--sash-hover-transition-duration: 0.1s;
}
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Build for production
pnpm build
# Run type checking
pnpm vue-tsc
This Vue port is based on the excellent Allotment React library by John Walley.
MIT
FAQs
Vue 3 port of React Allotment - resizable split views with draggable dividers
The npm package vue-allotment receives a total of 1 weekly downloads. As such, vue-allotment popularity was classified as not popular.
We found that vue-allotment demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.