# Resizable panels

A controlled two-panel layout with a labelled separator, direction-aware keyboard resizing, native pointer drag and an automatic stacked…

Access: pro. Category: Essentials. Kind: composite.

## When to use

- Use it when a page needs a controlled two-panel layout with a labelled separator, direction-aware keyboard resizing, native pointer drag and an automatic stacked phone layout.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.

## Alternatives

- Choose tidal-button instead when press, loading, success and disabled states is the actual interface need, rather than resizable panels.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Resizable panels

```sh
npx shadcn@latest add @tidal-pro/resizable-panels
```

Stylesheets: `components/ui/tidal.css`, `components/ui/resizable-panels.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/resizable-panels.css";
import{TidalResizablePanels}from"./components/ui/resizable-panels";
export default()=><div className="tidal-scope"><TidalResizablePanels onValueChange={() => {}} primaryPanel={{content:"value"}} secondaryPanel={{content:"value"}} separatorLabel={"Demo"} value={1}/></div>;
```

## Structured props

- `TidalResizablePanels.onValueChange: (value: number, event: TidalResizableChangeEvent, source: TidalResizableChangeSource) => void`: Callback invoked when the value change interaction is proposed.
- `TidalResizablePanels.primaryPanel: TidalResizablePanel`: Required primary panel value accepted by this exported component.
- `TidalResizablePanels.secondaryPanel: TidalResizablePanel`: Required secondary panel value accepted by this exported component.
- `TidalResizablePanels.separatorLabel: string`: Required separator label value accepted by this exported component.
- `TidalResizablePanels.value: number`: Required value value accepted by this exported component.
- `TidalResizablePanels.disabled?: boolean | undefined` (default false): Optional disabled value accepted by this exported component.
- `TidalResizablePanels.formatValue?: ((value: number) => string) | undefined`: Optional format value value accepted by this exported component.
- `TidalResizablePanels.maxValue?: number | undefined` (default 76): Optional max value value accepted by this exported component.
- `TidalResizablePanels.minValue?: number | undefined` (default 24): Optional min value value accepted by this exported component.
- `TidalResizablePanels.separatorProps?: Omit<HTMLAttributes<HTMLDivElement>, "tabIndex" | "role" | "aria-controls" | "aria-disabled" | "aria-label" | "aria-orientation" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children"> | undefined`: Optional separator props value accepted by this exported component.
- `TidalResizablePanels.separatorRef?: Ref<HTMLDivElement> | undefined`: Optional separator ref value accepted by this exported component.
- `TidalResizablePanels.step?: number | undefined` (default 4): Optional step value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/resizable-panels.tsx) | [Manifest](https://tidalui.com/examples/resizable-panels.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useRef, useState } from "react";

import { TidalResizablePanels } from "./components/ui/resizable-panels";

import "./components/ui/resizable-panels.css";



const tidalExampleStyles = ".tidal-scope .resizable-demo,\n.tidal-scope .resizable-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .resizable-demo {\n  width: 100%;\n  min-width: 0;\n  color: var(--t-ink);\n  container: resizable-demo / inline-size;\n  font-family: Inter, ui-sans-serif, system-ui, sans-serif;\n}\n\n.tidal-scope .resizable-demo-frame {\n  min-width: 0;\n  padding: clamp(8px, 2.8cqi, 28px);\n}\n\n.tidal-scope .resizable-demo-browser,\n.tidal-scope .resizable-demo-document {\n  min-width: 0;\n  min-height: 100%;\n}\n\n.tidal-scope .resizable-demo-browser {\n  display: flex;\n  flex-direction: column;\n  padding: 20px;\n  background: var(--t-subtle);\n}\n\n.tidal-scope .resizable-demo-browser-head,\n.tidal-scope .resizable-demo-document > header,\n.tidal-scope .resizable-demo-document > footer {\n  display: flex;\n  min-width: 0;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n}\n\n.tidal-scope .resizable-demo-browser-head > div {\n  min-width: 0;\n}\n\n.tidal-scope .resizable-demo-browser-head span,\n.tidal-scope .resizable-demo-document > header,\n.tidal-scope .resizable-demo-document-copy > p:first-child {\n  color: var(--t-muted);\n  font-size: 11px;\n  font-weight: 680;\n  letter-spacing: 0.09em;\n  line-height: 1.4;\n  text-transform: uppercase;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .resizable-demo-browser-head > span {\n  display: grid;\n  width: 28px;\n  height: 28px;\n  flex: none;\n  place-items: center;\n  border: 1px solid var(--t-border);\n  border-radius: 7px;\n  background: var(--t-surface);\n}\n\n.tidal-scope .resizable-demo-browser h2,\n.tidal-scope .resizable-demo-document h2 {\n  margin: 4px 0 0;\n  font-size: 18px;\n  font-weight: 690;\n  letter-spacing: -0.045em;\n  line-height: 1.1;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .resizable-demo-document-list {\n  display: grid;\n  min-width: 0;\n  gap: 7px;\n  margin-top: 20px;\n}\n\n.tidal-scope .resizable-demo-document-list button {\n  display: grid;\n  min-width: 0;\n  min-height: 54px;\n  grid-template-columns: 36px minmax(0, 1fr);\n  grid-template-rows: auto auto;\n  align-items: center;\n  column-gap: 10px;\n  padding: 8px 10px;\n  border: 1px solid transparent;\n  border-radius: 10px;\n  background: transparent;\n  color: var(--t-ink);\n  font: inherit;\n  text-align: start;\n  cursor: pointer;\n  animation: resizable-demo-row 420ms var(--t-ease-out) both;\n  animation-delay: calc(min(var(--resizable-demo-index), 4) * 55ms + 120ms);\n  transition:\n    border-color 180ms,\n    background 180ms,\n    color 180ms,\n    transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .resizable-demo-document-list button > span {\n  display: grid;\n  width: 34px;\n  height: 34px;\n  grid-row: 1 / 3;\n  place-items: center;\n  border: 1px solid var(--t-border);\n  border-radius: 7px;\n  background: var(--t-surface);\n  color: var(--t-muted);\n  font-size: 11px;\n  font-weight: 700;\n  letter-spacing: 0.04em;\n}\n\n.tidal-scope .resizable-demo-document-list button strong,\n.tidal-scope .resizable-demo-document-list button small {\n  min-width: 0;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .resizable-demo-document-list button strong {\n  align-self: end;\n  font-size: 11px;\n  line-height: 1.25;\n}\n\n.tidal-scope .resizable-demo-document-list button small {\n  align-self: start;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.35;\n}\n\n.tidal-scope .resizable-demo-document-list button[aria-pressed=\"true\"] {\n  border-color: var(--t-ink);\n  background: var(--t-ink);\n  color: var(--t-surface);\n}\n\n.tidal-scope .resizable-demo-document-list button[aria-pressed=\"true\"] > span {\n  border-color: var(--t-surface);\n  background: var(--t-surface);\n  color: var(--t-ink);\n}\n\n.tidal-scope .resizable-demo-document-list button[aria-pressed=\"true\"] small {\n  color: var(--t-surface);\n  opacity: 0.7;\n}\n\n.tidal-scope\n  .resizable-demo-document-list\n  button:not([aria-pressed=\"true\"]):hover {\n  border-color: var(--t-border);\n  background: var(--t-surface);\n}\n\n.tidal-scope .resizable-demo-document-list button:active,\n.tidal-scope .resizable-demo-balance:active {\n  transform: scale(0.98);\n}\n\n.tidal-scope .resizable-demo-document-list button:focus-visible,\n.tidal-scope .resizable-demo-balance:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 2px;\n}\n\n.tidal-scope .resizable-demo-balance {\n  min-width: 0;\n  min-height: 44px;\n  margin-top: auto;\n  padding: 9px 12px;\n  border: 1px solid var(--t-border);\n  border-radius: 10px;\n  background: var(--t-surface);\n  color: var(--t-ink);\n  font: inherit;\n  font-size: 11px;\n  font-weight: 680;\n  line-height: 1.35;\n  overflow-wrap: anywhere;\n  cursor: pointer;\n  transition:\n    border-color 180ms,\n    background 180ms,\n    color 180ms,\n    transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .resizable-demo-balance:hover {\n  border-color: var(--t-ink);\n}\n\n.tidal-scope .resizable-demo-document {\n  display: flex;\n  flex-direction: column;\n  padding: clamp(22px, 4cqi, 38px);\n  background: var(--t-surface);\n}\n\n.tidal-scope .resizable-demo-document > header {\n  padding-bottom: 15px;\n  border-bottom: 1px solid var(--t-border);\n}\n\n.tidal-scope .resizable-demo-document-copy {\n  min-width: 0;\n  padding: 30px 0 24px;\n}\n\n.tidal-scope .resizable-demo-document h2 {\n  max-width: 520px;\n  margin-top: 10px;\n  font-size: clamp(28px, 5cqi, 48px);\n}\n\n.tidal-scope .resizable-demo-document-copy > p:last-child {\n  max-width: 560px;\n  margin: 16px 0 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.7;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .resizable-demo-document ol {\n  padding: 0;\n  margin: 0;\n  border-top: 1px solid var(--t-border);\n  list-style: none;\n}\n\n.tidal-scope .resizable-demo-document li {\n  display: grid;\n  min-width: 0;\n  min-height: 48px;\n  grid-template-columns: 32px minmax(0, 1fr) auto;\n  align-items: center;\n  gap: 10px;\n  border-bottom: 1px solid var(--t-border);\n  font-size: 11px;\n}\n\n.tidal-scope .resizable-demo-document li > span {\n  color: var(--t-muted);\n  font-size: 11px;\n}\n\n.tidal-scope .resizable-demo-document li strong {\n  min-width: 0;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .resizable-demo-document > footer {\n  flex-wrap: wrap;\n  margin-top: auto;\n  padding-top: 22px;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.5;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .resizable-demo-document output {\n  color: var(--t-ink);\n  font-weight: 680;\n}\n\n@container resizable-demo (max-width: 560px) {\n  .tidal-scope .resizable-demo-frame {\n    padding: 6px;\n  }\n\n  .tidal-scope .resizable-demo-browser,\n  .tidal-scope .resizable-demo-document {\n    padding: 17px;\n  }\n\n  .tidal-scope .resizable-demo-document-list {\n    margin-top: 13px;\n  }\n\n  .tidal-scope .resizable-demo-document-list button {\n    min-height: 48px;\n  }\n\n  .tidal-scope .resizable-demo-balance {\n    font-size: 16px;\n  }\n\n  .tidal-scope .resizable-demo-document-copy {\n    padding-block: 19px 16px;\n  }\n\n  .tidal-scope .resizable-demo-document h2 {\n    font-size: 28px;\n  }\n\n  .tidal-scope .resizable-demo-document li {\n    min-height: 44px;\n  }\n\n  .tidal-scope .resizable-demo-document > footer {\n    padding-top: 15px;\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tidal-scope .resizable-demo-document-list button,\n  .tidal-scope .resizable-demo-balance {\n    animation: none;\n    transition: none;\n  }\n\n  .tidal-scope .resizable-demo-document-list button:active,\n  .tidal-scope .resizable-demo-balance:active {\n    transform: none;\n  }\n}\n\n@keyframes resizable-demo-row {\n  from {\n    opacity: 0;\n    transform: translateY(7px);\n  }\n  to {\n    opacity: 1;\n    transform: none;\n  }\n}";

const DOCUMENTS = [
  {
    id: "launch-brief",
    code: "BR-18",
    title: "Launch brief",
    type: "Brief",
    updated: "Edited today",
    summary:
      "A compact plan for the fictional October release review, including the handoff order and open questions.",
    sections: ["Release goal", "Review order", "Open questions"],
  },
  {
    id: "research-notes",
    code: "NT-07",
    title: "Research notes",
    type: "Notes",
    updated: "Edited yesterday",
    summary:
      "Collected observations from a local sample review of navigation, narrow layouts, and keyboard paths.",
    sections: ["Navigation", "Compact layouts", "Keyboard paths"],
  },
  {
    id: "release-checklist",
    code: "CK-24",
    title: "Release checklist",
    type: "Checklist",
    updated: "Edited Oct 12",
    summary:
      "The fictional checks used to prepare a local preview before a separate browser acceptance pass.",
    sections: ["Source review", "Responsive preview", "Release notes"],
  },
] as const;

export function ResizablePanelsDemo() {
  const [value, setValue] = useState(42);
  const [selectedId, setSelectedId] = useState<
    (typeof DOCUMENTS)[number]["id"]
  >(DOCUMENTS[0].id);
  const separatorRef = useRef<HTMLDivElement>(null);
  const selected =
    DOCUMENTS.find((document) => document.id === selectedId) ?? DOCUMENTS[0];

  return (
    <section className="resizable-demo" aria-label="Document workspace preview">
      <div className="resizable-demo-frame">
        <TidalResizablePanels
          value={value}
          onValueChange={setValue}
          separatorLabel="Resize document list and document detail"
          formatValue={(nextValue) =>
            `Document list ${nextValue} percent, document detail ${100 - nextValue} percent`
          }
          separatorRef={separatorRef}
          primaryPanel={{
            label: "Documents",
            content: (
              <div className="resizable-demo-browser">
                <div className="resizable-demo-browser-head">
                  <div>
                    <span>Workspace</span>
                    <h2>Documents</h2>
                  </div>
                  <span>{DOCUMENTS.length}</span>
                </div>
                <div
                  className="resizable-demo-document-list"
                  role="group"
                  aria-label="Sample documents"
                >
                  {DOCUMENTS.map((document, index) => (
                    <button
                      key={document.id}
                      type="button"
                      aria-pressed={document.id === selected.id}
                      onClick={() => setSelectedId(document.id)}
                      style={
                        {
                          "--resizable-demo-index": index,
                        } as React.CSSProperties
                      }
                    >
                      <span>{document.code}</span>
                      <strong>{document.title}</strong>
                      <small>{document.type}</small>
                    </button>
                  ))}
                </div>
                <button
                  type="button"
                  className="resizable-demo-balance"
                  onClick={() => {
                    setValue(50);
                    separatorRef.current?.focus({ preventScroll: true });
                  }}
                >
                  Balance panels
                </button>
              </div>
            ),
          }}
          secondaryPanel={{
            label: "Selected document detail",
            content: (
              <article className="resizable-demo-document">
                <header>
                  <span>{selected.code}</span>
                  <span>{selected.updated}</span>
                </header>
                <div className="resizable-demo-document-copy">
                  <p>{selected.type}</p>
                  <h2>{selected.title}</h2>
                  <p>{selected.summary}</p>
                </div>
                <ol>
                  {selected.sections.map((section, index) => (
                    <li key={section}>
                      <span>{String(index + 1).padStart(2, "0")}</span>
                      <strong>{section}</strong>
                      <span aria-hidden="true">↗</span>
                    </li>
                  ))}
                </ol>
                <footer>
                  <output>
                    List {value}% · Detail {100 - value}%
                  </output>
                  <span>Fictional documents for this local preview.</span>
                </footer>
              </article>
            ),
          }}
        />
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <ResizablePanelsDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

primaryPanel and secondaryPanel are required consumer-owned panel definitions with content plus optional accessible label or labelledBy, native panel attributes and refs. value is the controlled primary-panel percentage; onValueChange receives the clamped stepped value, native event and keyboard or pointer source. separatorLabel gives the separator its required accessible name. Optional minValue, maxValue and step define the normalized range; reversed finite bounds are normalized and invalid values use safe defaults. formatValue localizes the announced split. disabled or an equal bound range removes the separator tab stop and suppresses value requests. Native separator handlers run first and prevention suppresses owned key or pointer-start behavior. The separator supports Home/End and direction-aware Left/Right keys in the wide inline split, then reports horizontal orientation and uses Up/Down keys in the automatic stacked layout. Pointer drag uses capture on the separator without document listeners. Root and separator native attributes and root, separator and panel refs pass through. The component performs no data mutation, request, route, network, storage or persistence action.
