Layout

Resizable

Drag-to-resize panel groups for building split-pane layouts, powered by react-resizable-panels.

Preview
01 Installation

Install

Pull Resizable from the barrel for everyday use, or the granular path when you want a tighter bundle.

tsxBarrel1 line
import { Resizable } from "@brika/clay";
tsxGranular1 line
import { Resizable } from "@brika/clay/components/resizable";
02 Usage

A minimal example

Drop this into a page. Native HTML attributes pass through to the underlying primitive.

tsxResizable.tsx25 lines
import {
  ResizableHandle,
  ResizablePanel,
  ResizablePanelGroup,
} from '@brika/clay/components/resizable';
export default function ResizableDefaultDemo() {
  return (
    <ResizablePanelGroup
      orientation="horizontal"
      className="max-w-md rounded-lg border"
    >
      <ResizablePanel defaultSize={50}>
        <div className="flex h-32 items-center justify-center p-6 text-sm">
          Left
        </div>
      </ResizablePanel>
      <ResizableHandle withHandle />
      <ResizablePanel defaultSize={50}>
        <div className="flex h-32 items-center justify-center p-6 text-sm">
          Right
        </div>
      </ResizablePanel>
    </ResizablePanelGroup>
  );
}
03 Examples

Resizable, every way

Vertical

04 Accessibility

Accessibility

  • The resize handle carries role="separator" and responds to arrow keys for keyboard resizing.
  • withHandle renders a visible grip icon, improving discoverability of the resize affordance.
  • Ensure panels have meaningful aria-label values when used as distinct content regions.
05 Tokens 7 theme-overridable

Theme tokens

Every CSS variable Resizable reads, with its default and the dotted path you'd write in a ThemeConfig JSON to override it. Set any of these in your theme to retune Resizable without touching component code.

Resizable tokens

7 tokens
ColorFill, border, and text colors.6
  • --resizable-handle-colorcolorvar(--border)
    components.resizable.handleColor

    Resting handle color.

  • --resizable-handle-hovercolorvar(--primary)
    components.resizable.handleHover

    Hover-state handle color; applied at 40% opacity.

  • --resizable-handle-ringcolorvar(--ring)
    components.resizable.handleRing

    Focus ring color drawn around the handle when keyboard-focused.

  • --resizable-grip-bordercolorvar(--border)
    components.resizable.gripBorder

    Border color of the optional grip pill rendered when `withHandle` is set.

  • --resizable-grip-containercolorvar(--background)
    components.resizable.gripContainer

    Background fill of the optional grip pill rendered when `withHandle` is set.

  • --resizable-grip-iconcolorvar(--muted-foreground)
    components.resizable.gripIcon

    Icon color of the grip glyph drawn inside the optional grip pill.

GeometrySizes, lengths, and corner radii.1
  • --resizable-handle-sizesize1px
    components.resizable.handleSize

    Resize handle thickness along the resize axis.

Override in a theme

Authoring a theme is plain JSON. Drop overrides under components.resizable, the names are camelCase versions of the variable suffix.

jsonmy-theme.json12 lines
{
  "id": "my-theme",
  "name": "My Theme",
  "description": "...",
  "accentSwatches": ["#000"],

  "components": {
    "resizable": {
      "handleSize": "1px"
    }
  }
}

Then apply with applyTheme(myTheme) (see the theming guide), scope it to a subtree with themeToCssVars(myTheme, mode), or consume any token directly in your own JSX with the matching Tailwind utility (e.g. bg-resizable-…) — see the chips on each token row.

06 API reference

API reference

Props specific to Resizable. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.

<ResizableHandle />

1 prop
  • boolean
    Renders a visible grip icon on the handle.

<ResizablePanel />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<ResizablePanelGroup />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.