Skip to content

Window Splitter

Resize adjacent panes with a quantized, keyboard-accessible separator.

Usage

Horizontal

Use horizontal movement while preserving the same value and boundary rules.

Project
App.vueSaved
<script setup lang="ts">
const release = 'stable'
</script>

<template>
  <ReleaseCard :channel="release" />
</template>

Vertical

Use vertical movement while preserving the same pane-size rules.

Editormain.ts
import { createApp } from 'vue'
import App from './App.vue'

createApp(App).mount('#app')
Terminalzsh

$ pnpm test 18 passed

Controlled

Let the parent own the current value and apply accepted changes back to the component.

Workspace
SplitPane.vueTypeScript
const layout = {
  sidebar: '28%',
  editor: '68%'
}
Preview readyBoth separators remain independently adjustable.

Examples

Mixed orientation

Combine a resizable sidebar with an independently adjustable editor and preview stack.

Workspace
SplitPane.vueTypeScript
const layout = {
  sidebar: '28%',
  editor: '68%'
}
Preview readyBoth separators remain independently adjustable.

API

Vue package: @sectile/vue/window-splitter

Components
  • WindowSplitterRoot
  • WindowSplitterPane
  • WindowSplitterHandle

Props

WindowSplitterRootProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

defaultValue

Initial value used when the component owns its state.

disabled

Whether interaction is unavailable.

form

ID of the native form associated with the control.

formatValue

Formats a value for visible text.

label

Accessible name announced for the control.

max

Largest value accepted by the component.

min

Smallest value accepted by the component.

modelValue

Current value when state is controlled by the parent.

name

Name used for native form submission.

orientation

Axis used for layout and keyboard movement.

pageStep

Larger increment used by Page Up and Page Down.

required

Whether the control must contain a valid value before submission.

step

Smallest value increment accepted by the component.

WindowSplitterPaneProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

side

Preferred side of the anchor for positioned content.

Events

WindowSplitterRoot

update:modelValue

Emitted when the component requests a new controlled value.

Other types

WindowSplitterValueFormatter

ts
type WindowSplitterValueFormatter = NonNullable<WindowSplitterRootProps['formatValue']>

WindowSplitterValueChangeHandler

ts
type WindowSplitterValueChangeHandler = (value: string) => void

Parts

Shared scope: [data-scope="window-splitter"]. Combine it with a part selector to keep styles local to this component.

PartSelectorRoleExtra attributes
root[data-part="root"]Defines the component boundary and owns its composed parts.
pane[data-part="pane"]Contains one resizable region.
handle[data-part="handle"]Resizes adjacent panes.

Keyboard interaction

KeyBehavior
Arrow Left / Arrow RightMake the leading pane one step smaller or larger in a horizontal layout.
Arrow Up / Arrow DownMake the leading pane one step smaller or larger in a vertical layout.
Home / EndMove the separator to its minimum or maximum boundary.
Page Up / Page DownResize by the configured page step.

Accessibility

The handle exposes separator orientation and current, minimum, and maximum pane size.

See the corresponding WAI-ARIA pattern for the host accessibility contract.

Released under the MIT License.