StorybookGitHub

Resizable

Accessible resizable panel groups and layouts.

Explorerindex.tsutils.ts
Select a file to preview

Installation

npx shadcn-vue@latest add https://vuedocs.canceydejean.dev/r/resizable.json

Usage

Use resizable panels for split views like code editors or file browsers, where users need to adjust the space given to adjacent panels. Set direction="horizontal" or "vertical" on the group and give each panel a default-size.

<script setup lang="ts">
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/components/ui/resizable";
</script>

<template>
  <ResizablePanelGroup direction="horizontal" class="max-w-md rounded-lg border">
    <ResizablePanel :default-size="50">
      <div class="flex h-40 items-center justify-center p-6">
        <span class="font-semibold">One</span>
      </div>
    </ResizablePanel>
    <ResizableHandle with-handle />
    <ResizablePanel :default-size="50">
      <div class="flex h-40 items-center justify-center p-6">
        <span class="font-semibold">Two</span>
      </div>
    </ResizablePanel>
  </ResizablePanelGroup>
</template>

Built on reka-ui's Splitter primitives.