shadcn.io is not affiliated with official shadcn/ui
Components
Free
Resizable for Svelte
Drag a handle between panels so they trade space, for a split editor or a list beside its detail. In Svelte with Ark UI, when people should set the sizes themselves.
Framework
UI library
Two panels that share an edge, with a handle that sets how much room each one gets.
Use it when people should choose the split, like a file tree beside code. A column that also holds the app's links is a Sidebar. In Svelte, Ark UI exposes the handle as a button named Resize, so the arrow keys work once it has focus.
Installation
Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
Header over content, starting near a quarter and three quarters, with the handle drawn as a line. Set orientation to vertical for a top and bottom split, such as a toolbar over a canvas. The line can still be focused and dragged. Give the group a height, or a vertical split collapses and the handle sits in an empty gap.
Handle
Sidebar and content start near a quarter and three quarters, with withHandle drawing a grip on the trigger. Use the grip when the split is easy to miss, a faint line on a light page. Without it the target is only thinner, which is enough between panels that already have a strong edge. Either way it is one tab stop, and the arrow keys resize once it is focused.
Rtl
The hero's nested split, with Arabic labels and dir set to rtl on the outer group and the inner vertical group. The horizontal handle still divides the columns, and the inner handle divides the stacked panes. The grip should not need a flipped stylesheet if positioning stays logical. Drag it and confirm the panes grow from the correct edge.
FAQ
How do I set Resizable panel sizes with Ark UI?
Give every panel a starting size, then let the drag handle change it. The default orientation is horizontal, so the sizes are widths until you set orientation to vertical.
Pass defaultSize as an array of sizes on Resizable, and list each panel in panels with an id. The resize trigger id joins those two ids with a colon, such as 1:2, or pass size instead of defaultSize to control the layout and read updates from onResize.
How do I stack a Resizable vertically?
Set orientation to vertical on Resizable. The panels stack, and the handle runs across the width. The Vertical demo uses that layout, and a nested group can use a different orientation from its parent. Leave orientation unset, or set it to horizontal, for panels that sit side by side.
How do I show a handle on a Resizable?
Set withHandle on ResizableResizeTrigger to show the grip, as the Handle demo does. Without it, the handle is still a thin line you can drag and focus. The control is a button named Resize, so keyboard users can reach it.
Can I use a Resizable from the keyboard in Svelte?
Yes, focus the resize handle, then use the arrow keys to change the panel sizes. Home and End jump toward the start and end of the range. The handle is one tab stop between the panels. See the Accessibility section for the full key list.
Can I nest a Resizable inside another panel?
Yes, put another Resizable inside a ResizablePanel and give that inner group its own orientation and sizes. The default demo nests a vertical group inside a horizontal one. Each group has its own handles. Sizes on the inner group are relative to that panel, not the page.
How do I style a Resizable?
Edit the resizable file under components/ui. The group sets data-slot to resizable, and the handle sets it to resizable-resize-trigger. Change the line thickness and the grip there. The handle already uses logical positioning, so the Rtl demo does not need a separate layout.
How do I install Resizable in Svelte?
Run the command in the Installation section above. It adds Resizable and its parts to your ui folder. Import from that folder when the command finishes, instead of copying the source by hand, and rerun the command later if you want the latest files.
The command uses the shadcn-svelte CLI.
API Reference
Resizable
<div>data-slot="resizable"
PropType
panelsPanelData[]
The size constraints of the panels.
defaultSize?PanelSize[]
The initial size of the panels when rendered.
Use when you don't need to control the size of the panels.
dir?"ltr" | "rtl"
The document's text/writing direction.
Type
"ltr" | "rtl"
Default
"ltr"
id?string
The unique identifier of the machine.
ids?object
The ids of the elements in the splitter. Useful for composition.