Skip to content

Resizable

Get Ritla UI

Panels people resize by dragging the handle between them: side by side editors, inboxes and dashboards.

Ritla scan of this preview: 41 of 41 checks3 breakpointsScanned

Open in Figma

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add resizable

    Also works with shadcn: npx shadcn@latest add @ritla/resizable

  2. Dependencies it brings

    @phosphor-icons/react

  3. Or copy by hand

    Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.

Usage

resizable.tsx
import { ResizableGroup, ResizableHandle, ResizablePanel } from "@/components/ui/resizable";<ResizableGroup>  <ResizablePanel defaultSize={36} minSize={20}>Sidebar</ResizablePanel>  <ResizableHandle withGrip />  <ResizablePanel minSize={30}>Content</ResizablePanel></ResizableGroup>

Examples

Vertical

orientation="vertical": top and bottom. ArrowDown makes the top panel taller.

EnglishMirroredArabic
LTR →

Nested

A vertical group inside a panel. The inner group is bare and its handle has no grip, as in Figma.

EnglishMirroredArabic
LTR →

Remember sizes

storageKey keeps the sizes in this browser so the layout survives a reload; onLayoutChange hands them to you to save per user on your server.

EnglishMirroredArabic
LTR →

API reference

ResizableGroup

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Figma's Layout: side by side or top and bottom. Nest a group in a panel for both.
storageKeystringNoneSaves the sizes in localStorage under this key.
onLayoutChange(sizes: number[]) => voidNoneThe sizes (%, in order) after each resize.
barebooleanfalseNo frame, for a group inside a panel.

ResizablePanel

PropTypeDefaultDescription
defaultSizenumberNoneThe starting size (%). Panels without one share the rest.
minSizenumber10The smallest size (%), so content never collapses.
maxSizenumber100The largest size (%).

ResizableHandle

PropTypeDefaultDescription
withGripbooleanfalseFigma's Grip: where resizing is the main task.
labelstring"Resize" / «تغيير الحجم»The handle's name for screen readers.
stepnumber5The arrow keys' step (%).

Usage guidelines

Resizable panels split a workspace with a handle between them. When to use them, their order in Arabic, and the checks before handoff.

1. Resizable panels

Two or three panels with a handle between them. Horizontal splits a workspace; Vertical splits an editor and output; Nested does both.

Do

  • Set a minimum width per panel.
  • Remember the last size per person.

Don't

  • Add a handle between more than three panels.
  • Resize both axes with one handle.

2. Arabic and RTL

Panel order mirrors; the handle keeps its grip.

Before handoff

  • Resizable Horizontal, Vertical and Nested shown.
  • Minimum sizes noted on each panel.

Accessibility

Keyboard

Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.

KeyAction
TabTo the handle.
ArrowRightArrowLeftMoves the handle in steps; in Arabic ArrowLeft widens the first panel.
ArrowDownArrowUpIn a vertical group.
HomeEndTo the first panel's smallest and largest size.

ARIA

  • The handle is a focusable role="separator" with aria-valuenow, aria-valuemin, aria-valuemax (the first panel's size) and aria-controls.
  • Its 48px drag area covers 24px of each panel, inside their padding.

Arabic and RTL notes

Mirrors

  • The first panel sits on the right.
  • Dragging and arrow keys follow the reading direction.

Does not mirror

  • Vertical groups don't change, and the grip dots don't mirror.
Numerals
Sizes you show follow the numerals setting in your UI.
Arabic typography
The group sets no type; panels bring their own content.
Mixed-direction text
Ritla UI builds its own splitter because the common alternatives hard-wire ArrowLeft to shrink the first panel, even in Arabic.

Do

  • The RTL variants, so the panel order mirrors.
  • Check that the first panel is still the primary one.

Checks it passes

The Ritla checks this component satisfies by construction. Used as documented, it does not bring these defects onto your page.

  • R042Clipped text: content wider than its box with overflow hidden and no ellipsis
  • R043Fixed-pixel-width container whose Arabic text exceeds the space
  • R050Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
  • R051letter-spacing applied to Arabic text (breaks the connected script)