Get Started
Migration
Components
- Accordion
- Alert Dialog
- Alert
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Formsnap
- Hover Card
- Input OTP
- Input
- Label
- Menubar
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Range Calendar
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Switch
- Table
- Tabs
- Textarea
- Toggle Group
- Toggle
- Tooltip
- Typography
Installation
Special sponsor
We're looking for one partner to be featured here.
Support the project and reach thousands of developers.
Reach outDocs Component Source
One
Two
Three
<script lang="ts">
import * as Resizable from "$lib/components/ui/resizable/index.js";
</script>
<Resizable.PaneGroup direction="horizontal" class="max-w-md rounded-lg border">
<Resizable.Pane defaultSize={50}>
<div class="flex h-[200px] items-center justify-center p-6">
<span class="font-semibold">One</span>
</div>
</Resizable.Pane>
<Resizable.Handle />
<Resizable.Pane defaultSize={50}>
<Resizable.PaneGroup direction="vertical">
<Resizable.Pane defaultSize={25}>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold">Two</span>
</div>
</Resizable.Pane>
<Resizable.Handle />
<Resizable.Pane defaultSize={75}>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold">Three</span>
</div>
</Resizable.Pane>
</Resizable.PaneGroup>
</Resizable.Pane>
</Resizable.PaneGroup>
About
The Resizable
component is built on top of PaneForge by Huntabyte. Visit the PaneForge documentation for all the available props and abilities of the Resizable
component.
Installation
pnpm dlx shadcn-svelte@latest add resizable
npx shadcn-svelte@latest add resizable
bun x shadcn-svelte@latest add resizable
npx shadcn-svelte@latest add resizable
Install paneforge
:
pnpm i paneforge@next -D
npm i paneforge@next -D
bun install paneforge@next -D
yarn install paneforge@next -D
Copy and paste the component source files linked at the top of this page into your project.
Usage
<script lang="ts">
import * as Resizable from "$lib/components/ui/resizable/index.js";
</script>
<Resizable.PaneGroup direction="horizontal">
<Resizable.Pane>One</Resizable.Pane>
<Resizable.Handle />
<Resizable.Pane>Two</Resizable.Pane>
</Resizable.PaneGroup>
Examples
Vertical
Use the direction
prop to set the direction of the resizable panels.
Header
Content
<script lang="ts">
import * as Resizable from "$lib/components/ui/resizable/index.js";
</script>
<Resizable.PaneGroup
direction="vertical"
class="min-h-[200px] max-w-md rounded-lg border"
>
<Resizable.Pane defaultSize={25}>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold">Header</span>
</div>
</Resizable.Pane>
<Resizable.Handle />
<Resizable.Pane defaultSize={75}>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold">Content</span>
</div>
</Resizable.Pane>
</Resizable.PaneGroup>
<script lang="ts">
import * as Resizable from "$lib/components/ui/resizable/index.js";
</script>
<Resizable.PaneGroup direction="vertical">
<Resizable.Pane>One</Resizable.Pane>
<Resizable.Handle />
<Resizable.Pane>Two</Resizable.Pane>
</Resizable.PaneGroup>
Handle
You can set or hide the handle by using the withHandle
prop on the ResizableHandle
component.
Sidebar
Content
<script lang="ts">
import * as Resizable from "$lib/components/ui/resizable/index.js";
</script>
<Resizable.PaneGroup
direction="horizontal"
class="min-h-[200px] max-w-md rounded-lg border"
>
<Resizable.Pane defaultSize={25}>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold">Sidebar</span>
</div>
</Resizable.Pane>
<Resizable.Handle withHandle />
<Resizable.Pane defaultSize={75}>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold">Content</span>
</div>
</Resizable.Pane>
</Resizable.PaneGroup>
<script lang="ts">
import * as Resizable from "$lib/components/ui/resizable/index.js";
</script>
<Resizable.PaneGroup direction="vertical">
<Resizable.Pane>One</Resizable.Pane>
<Resizable.Handle withHandle />
<Resizable.Pane>Two</Resizable.Pane>
</Resizable.PaneGroup>