---
title: "Resizable"
description: "Accessible resizable panel groups and layouts with keyboard support."
component: true
---

```tsx
import {
  ResizableHandle,
  ResizablePanel,
  ResizablePanelGroup
} from "~/components/ui/resizable"

export default function ResizableDemo() {
  return (
    <ResizablePanelGroup
      orientation="horizontal"
      class="h-[200px] max-w-sm rounded-lg border"
    >
      <ResizablePanel defaultSize={50}>
        <div class="flex h-[200px] items-center justify-center p-6">
          <span class="font-semibold">One</span>
        </div>
      </ResizablePanel>
      <ResizableHandle withHandle aria-label="Resize files" />
      <ResizablePanel defaultSize={50}>
        <ResizablePanelGroup orientation="vertical">
          <ResizablePanel defaultSize={25}>
            <div class="flex h-full items-center justify-center p-6">
              <span class="font-semibold">Two</span>
            </div>
          </ResizablePanel>
          <ResizableHandle withHandle aria-label="Resize editor panels" />
          <ResizablePanel defaultSize={75}>
            <div class="flex h-full items-center justify-center p-6">
              <span class="font-semibold">Three</span>
            </div>
          </ResizablePanel>
        </ResizablePanelGroup>
      </ResizablePanel>
    </ResizablePanelGroup>
  )
}
```

## About

The `Resizable` component styles [UI SDK Resizable](https://ui-sdk.dev/docs/solid/components/resizable) panels and handles.

## Installation

<CodeTabs>

<TabsList>
  <TabsTrigger value="cli">Command</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx solidui-cli@latest add resizable
```

</TabsContent>

<TabsContent value="manual">

<Steps class="mb-0 pt-2">

<Step>Install the following dependencies:</Step>

```bash
npm install @ui-sdk/solid @ui-sdk/core
```

<Step>Copy and paste the following code into your project.</Step>

```tsx title="components/ui/resizable.tsx"
import type { ComponentProps } from "@solidjs/web"
import {
  Resizable as SdkResizable,
  ResizablePanel as SdkResizablePanel,
  ResizableHandle as SdkResizableHandle
} from "@ui-sdk/solid/resizable"
import { omit } from "solid-js"

import { cn } from "~/lib/utils"

export function ResizablePanelGroup(
  props: Omit<ComponentProps<typeof SdkResizable>, "class"> & { class?: string }
) {
  return (
    <SdkResizable
      {...props}
      class={cn(
        "flex h-full w-full data-[orientation=vertical]:flex-col",
        props.class
      )}
    />
  )
}

export function ResizablePanel(
  props: Omit<ComponentProps<typeof SdkResizablePanel>, "class"> & {
    class?: string
  }
) {
  return (
    <SdkResizablePanel {...props} class={cn("min-h-0 min-w-0", props.class)} />
  )
}

export function ResizableHandle(
  props: Omit<ComponentProps<typeof SdkResizableHandle>, "class"> & {
    class?: string
    withHandle?: boolean
  }
) {
  const rest = omit(props, "class", "withHandle")
  return (
    <SdkResizableHandle
      {...rest}
      class={cn(
        "relative flex w-px shrink-0 items-center justify-center bg-border outline-none focus-visible:ring-1 focus-visible:ring-ring data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full",
        props.class
      )}
    >
      {props.withHandle && (
        <div class="h-6 w-1 rounded-lg bg-border z-10 flex shrink-0" />
      )}
    </SdkResizableHandle>
  )
}
```

<Step>Update the import paths to match your project setup.</Step>

</Steps>

</TabsContent>

</CodeTabs>

## Usage

```tsx showLineNumbers
import {
  ResizableHandle,
  ResizablePanel,
  ResizablePanelGroup
} from "~/components/ui/resizable"
```

```tsx showLineNumbers
<ResizablePanelGroup orientation="horizontal">
  <ResizablePanel defaultSize={50}>Files</ResizablePanel>
  <ResizableHandle aria-label="Resize panels" />
  <ResizablePanel defaultSize={50}>Editor</ResizablePanel>
</ResizablePanelGroup>
```

Use `orientation`, `onLayoutChange`, and `onLayoutCommit` on `ResizablePanelGroup`. Each panel accepts `defaultSize`, `minSize`, `maxSize`, and `collapsible`. Percentages are numbers. Name each handle with `aria-label`. Native SDK controllers replace React panel refs.

See the [UI SDK resizable API](https://ui-sdk.dev/docs/solid/components/resizable) for native options and keyboard behavior.

## Composition

Use the following composition to build a `ResizablePanelGroup`:

```text
ResizablePanelGroup
├── ResizablePanel
├── ResizableHandle
└── ResizablePanel
```

## Vertical

Use `orientation="vertical"` for vertical resizing.

```tsx
import {
  ResizableHandle,
  ResizablePanel,
  ResizablePanelGroup
} from "~/components/ui/resizable"

export default function ResizableVertical() {
  return (
    <ResizablePanelGroup
      orientation="vertical"
      class="min-h-[200px] max-w-sm rounded-lg border"
    >
      <ResizablePanel defaultSize={25}>
        <div class="flex h-full items-center justify-center p-6">
          <span class="font-semibold">Header</span>
        </div>
      </ResizablePanel>
      <ResizableHandle aria-label="Resize panels" />
      <ResizablePanel defaultSize={75}>
        <div class="flex h-full items-center justify-center p-6">
          <span class="font-semibold">Content</span>
        </div>
      </ResizablePanel>
    </ResizablePanelGroup>
  )
}
```

## Handle

Use the `withHandle` prop on `ResizableHandle` to show a visible handle.

```tsx
import {
  ResizableHandle,
  ResizablePanel,
  ResizablePanelGroup
} from "~/components/ui/resizable"

export default function ResizableHandleDemo() {
  return (
    <ResizablePanelGroup
      orientation="horizontal"
      class="min-h-[200px] max-w-md rounded-lg border md:min-w-[450px]"
    >
      <ResizablePanel defaultSize="25%">
        <div class="flex h-full items-center justify-center p-6">
          <span class="font-semibold">Sidebar</span>
        </div>
      </ResizablePanel>
      <ResizableHandle withHandle />
      <ResizablePanel defaultSize="75%">
        <div class="flex h-full items-center justify-center p-6">
          <span class="font-semibold">Content</span>
        </div>
      </ResizablePanel>
    </ResizablePanelGroup>
  )
}
```

## API Reference

See the [UI SDK Resizable API](https://ui-sdk.dev/docs/solid/components/resizable) for layout, sizing, and keyboard controls.
