Skip to content

useResizablePanel

Panel resizing composable for split layouts.

Import

typescript
const {
  panelWidth,
  isResizing,
  startResize,
  onResize,
  stopResize,
} = useResizablePanel(options)

Options

OptionTypeDefaultDescription
initialWidthnumber300Initial panel width (px)
minWidthnumber200Minimum width
maxWidthnumber600Maximum width

Return Values

PropertyTypeDescription
panelWidthRef<number>Current panel width
isResizingRef<boolean>Whether resize is in progress

Source

app/composables/useResizablePanel.ts

Built with VitePress