SplitLayout

A horizontal split layout with a draggable divider. Both panels take full height with overflow hidden. The divider drag works reliably even when panels contain iframes.

Basic Demo

Drag the divider between the panels. Current left width: 50%

Left Panel

This panel takes 50% of the width. The overflow is hidden on the panel itself, so child content should handle its own scrolling.

Try dragging the divider to resize.

Right Panel

This panel takes the remaining width. It has overflow: hidden by default.

Put scrollable content inside to enable scrolling within each panel.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

With Minimum Width Constraints

Set min-left-width and min-right-width to prevent panels from becoming too narrow.

Min 25%

This panel cannot go below 25% width.

Min 30%

This panel cannot go below 30% width.

Vertical Orientation

Set orientation="vertical" to split top-to-bottom. Use v-model:top-height for the top panel height. Current top height: 50%

Top Panel

This panel takes 50% of the height.

Bottom Panel

This panel takes the remaining height.

Opaque Divider

Set opaque to give the divider a visible background instead of the transparent default.

Left Panel

Opaque divider gives a solid background to the drag handle area.

Right Panel

Usage

Iframe Compatibility

When the divider is being dragged, both panels get pointer-events: none applied, preventing embedded iframes from capturing mouse events and breaking the drag.

Props

PropTypeDefaultDescription
orientationString'horizontal'Layout direction: 'horizontal' or 'vertical'
leftWidth (v-model)Number50Left panel width in percentage (horizontal mode)
minLeftWidthNumber20Minimum left panel width in percentage
minRightWidthNumber20Minimum right panel width in percentage
topHeight (v-model)Number50Top panel height in percentage (vertical mode)
minTopHeightNumber20Minimum top panel height in percentage
minBottomHeightNumber20Minimum bottom panel height in percentage
opaqueBooleanfalseWhether the divider has an opaque background

Events

EventPayloadDescription
update:leftWidthNumberEmitted when dragging ends with the final left width percentage (horizontal mode)
update:topHeightNumberEmitted when dragging ends with the final top height percentage (vertical mode)

Slots

SlotDescription
leftContent for the left panel
rightContent for the right panel (fills remaining space)