Resizable
Accessible resizable panel groups and layouts with keyboard support.
Installation
bash
npx shadcn-vue@latest add resizable
Usage
vue
<script setup lang="ts">
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from '@/components/ui/resizable'
</script>
<template>
<ResizablePanelGroup direction="horizontal">
<ResizablePanel>One</ResizablePanel>
<ResizableHandle />
<ResizablePanel>Two</ResizablePanel>
</ResizablePanelGroup>
</template>
Examples
Vertical
Use the direction prop to set the direction of the resizable panels.
vue
<script setup lang="ts">
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from '@/components/ui/resizable'
</script>
<template>
<ResizablePanelGroup direction="vertical">
<ResizablePanel>One</ResizablePanel>
<ResizableHandle />
<ResizablePanel>Two</ResizablePanel>
</ResizablePanelGroup>
</template>
Handle
You can set or hide the handle by using the withHandle prop on the ResizableHandle component.
vue
<script setup lang="ts">
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from '@/components/ui/resizable'
</script>
<template>
<ResizablePanelGroup direction="horizontal">
<ResizablePanel>One</ResizablePanel>
<ResizableHandle with-handle />
<ResizablePanel>Two</ResizablePanel>
</ResizablePanelGroup>
</template>