Editor split
Let readers allocate space between a file list and an editor.
Components / Layout
Keyboard- and pointer-resizable horizontal or vertical panel groups.
Last changed in version 0.13.0: Add avatar groups and chips, expand the block gallery, and improve component colors, spacing, and motion.
Explorer
<script setup>
const project = ref('Aurora')
const ready = computed(() => true)
</script>Aurora preview
Live workspace panel
bunx --bun @getweini/cli@latest add resizableImport the files copied by the install command, then place the component in your Vue template. The text and values in the example belong to your app; change them to fit your task.
<script setup lang="ts">
import ResizableGroup from './components/ui/resizable/ResizableGroup.vue'
import ResizableHandle from './components/ui/resizable/ResizableHandle.vue'
import ResizablePanel from './components/ui/resizable/ResizablePanel.vue'
</script>
<template>
<ResizableGroup
class="h-80 w-full overflow-hidden rounded-ui border border-border"
orientation="horizontal"
>
<ResizablePanel :default-size="30" :min-size="20" class="bg-muted/30 p-4">Files</ResizablePanel>
<ResizableHandle aria-label="Resize file list" />
<ResizablePanel :default-size="70" :min-size="35" class="p-4">Editor</ResizablePanel>
</ResizableGroup>
</template>Handles expose separator values and support arrows, Home, End, Enter, pointer dragging, nesting, and collapsible constraints.
Let readers allocate space between a file list and an editor.
Resize source and preview panes while preserving minimum useful widths.
Default percentages add up to the available group space.
<script setup lang="ts">
import ResizableGroup from './components/ui/resizable/ResizableGroup.vue'
import ResizableHandle from './components/ui/resizable/ResizableHandle.vue'
import ResizablePanel from './components/ui/resizable/ResizablePanel.vue'
</script>
<template>
<ResizableGroup
class="h-80 w-full overflow-hidden rounded-ui border border-border"
orientation="horizontal"
>
<ResizablePanel :default-size="30" :min-size="20" class="bg-muted/30 p-4">Files</ResizablePanel>
<ResizableHandle aria-label="Resize file list" />
<ResizablePanel :default-size="70" :min-size="35" class="p-4">Editor</ResizablePanel>
</ResizableGroup>
</template>The same contract also works from top to bottom.
<script setup lang="ts">
import ResizableGroup from './components/ui/resizable/ResizableGroup.vue'
import ResizableHandle from './components/ui/resizable/ResizableHandle.vue'
import ResizablePanel from './components/ui/resizable/ResizablePanel.vue'
</script>
<template>
<ResizableGroup class="h-96" orientation="vertical" :default-value="[60, 40]">
<ResizablePanel :min-size="25">Preview</ResizablePanel>
<ResizableHandle aria-label="Resize preview and logs" />
<ResizablePanel :min-size="20">Build logs</ResizablePanel>
</ResizableGroup>
</template>Every public prop, model, event, slot, and exposed member of the installed Vue parts is listed below. “Not set” means you can leave that value out; “Required” means you must provide it. Native HTML attributes also work where the component uses a native element.
| Name | Type or signature | Default | What it does |
|---|---|---|---|
orientationprop | ResizableOrientation | undefined | "horizontal" | Arrange items horizontally or vertically. |
directionprop | ResizableDirection | undefined | "ltr" | Choose the direction in which this control lays out or moves. |
modelValuemodel | readonly number[] | undefined | Not set | Current value. Use v-model to keep it in sync with your page. |
defaultValueprop | readonly number[] | undefined | [] | Starting value when the parent does not control the value. |
keyboardStepprop | number | undefined | 2 | Amount to change for one keyboard step. |
disabledprop | boolean | undefined | false | Prevent interaction and show the disabled state. |
resizeevent | [sizes: number[]] | — | Emitted when resize happens. |
update:modelValueevent | [sizes: number[]] | — | Requests a new model value from the parent. |
defaultslot | () => unknown | Required | Content shown inside ResizableGroup. |
elementexposed | HTMLElement | null | — | Reference to the underlying HTML element. |
sizesexposed | number[] | — | Access sizes from a component template ref. |
setSizesexposed | (next: number[]) => void | — | Access set sizes from a component template ref. |
| Name | Type or signature | Default | What it does |
|---|---|---|---|
disabledprop | boolean | undefined | false | Prevent interaction and show the disabled state. |
defaultslot | () => unknown | Required | Content shown inside ResizableHandle. |
| Name | Type or signature | Default | What it does |
|---|---|---|---|
defaultSizeprop | number | undefined | Not set | Starting size when the parent does not control it. |
minSizeprop | number | undefined | 10 | Smallest allowed panel or item size. |
maxSizeprop | number | undefined | 100 | Largest allowed panel or item size. |
collapsibleprop | boolean | undefined | false | Allow this panel to collapse. |
collapsedSizeprop | number | undefined | 0 | Size to keep visible when this panel is collapsed. |
disabledprop | boolean | undefined | false | Prevent interaction and show the disabled state. |
defaultslot | (props: { size: number; collapsed: boolean; }) => unknown | Required | Content shown inside ResizablePanel. |
// packages/frameworks/vue/components/resizable/types.ts
// ------- TYPES -------
export type ResizableOrientation = 'horizontal' | 'vertical'
export type ResizableDirection = 'ltr' | 'rtl'
export interface ResizableGroupProps {
orientation?: ResizableOrientation
direction?: ResizableDirection
modelValue?: readonly number[]
defaultValue?: readonly number[]
keyboardStep?: number
disabled?: boolean
}
export interface ResizablePanelProps {
defaultSize?: number
minSize?: number
maxSize?: number
collapsible?: boolean
collapsedSize?: number
disabled?: boolean
}
export interface ResizableHandleProps {
disabled?: boolean
}