Layout

Resizable

Two panels that share one space, with a handle people drag or move with the keyboard.

Class nameTypeDescription
resizableplf:resizableComponentTwo panels and a handle
resizable-panelplf:resizable-panelPartOne of the two panels
resizable-handleplf:resizable-handlePartThe handle between the panels
resizable-gripplf:resizable-gripPartAn optional box that draws a grip icon
resizable-iconplf:resizable-iconPartYour own SVG in the grip, in place of the drawn one; an icon class there doesn't need it

Default

The group takes exactly these three children: a panel is named by its first heading, or by aria-label, and the handle starts hidden; the script names it after the first panel.

Customers

Recent accounts

Olivia Martin

olivia@example.com

Pro

Jackson Lee

jackson@example.com

Sofia Davis

sofia@example.com

Customer details

Olivia Martin · Pro account

Overview

Active since January 2026. Monthly billing, with a dedicated workspace for design and reporting.

Lifetime revenue

$2,480.00

Team members

12

Each panel scrolls independently. On narrow screens, both panels remain readable in a stacked layout.

Monthly summary

Total revenue

$18,420.00

New customers

126

Recent activity

Monthly report is ready

Today at 09:42

Report

Olivia upgraded to Pro

Today at 08:30

Weekly invoice processed

Yesterday at 16:15

Sizes

The first panel’s size and bounds are enough: the second panel takes the rest.

Customers

Recent accounts

Olivia Martin

olivia@example.com

Pro

Jackson Lee

jackson@example.com

Sofia Davis

sofia@example.com

Customer details

Olivia Martin · Pro account

Overview

Active since January 2026. Monthly billing, with a dedicated workspace for design and reporting.

Lifetime revenue

$2,480.00

Team members

12

Each panel scrolls independently. On narrow screens, both panels remain readable in a stacked layout.

Disabled

A disabled surrounding <fieldset> also blocks resizing.

Customers

Recent accounts

Olivia Martin

olivia@example.com

Pro

Jackson Lee

jackson@example.com

Sofia Davis

sofia@example.com

Customer details

Olivia Martin · Pro account

Overview

Active since January 2026. Monthly billing, with a dedicated workspace for design and reporting.

Lifetime revenue

$2,480.00

Team members

12

Each panel scrolls independently. On narrow screens, both panels remain readable in a stacked layout.

Remember sizes

The script restores the size this browser saved, and saves each new one.

Files

index.html

styles.css

Editor

Drag the handle; the next visit opens at the same size.

JavaScript

Resizable needs JavaScript. The Full script (pelatform-ui.min.js) starts every component on page load, with no code of your own; with ESM imports, call init() yourself, as in Installation. For markup you add later, see Dynamic content.

<link rel="stylesheet" href="pelatform-ui.min.css">
<script src="pelatform-ui.min.js" defer></script>
<link rel="stylesheet" href="pelatform-ui.prefixed.min.css">
<script src="pelatform-ui.min.js" defer></script>
Attribute Purpose
data-plf-resizable Marks the group
data-plf-orientation horizontal (default) or vertical
data-plf-size On a panel: its starting size in percent; 50 by default. One panel’s size is enough, and two must total 100
data-plf-min-size, data-plf-max-size On a panel: its bounds in percent; 15 and 85 by default. The second panel’s bounds follow from the first’s unless it gives its own
data-plf-stack-at On the group: the width in pixels below which the panels stack and the handle hides; 480 by default, 0 never stacks
aria-disabled="true" On the group: blocks resizing

The script shows the handle and sets its role="separator", aria-orientation, aria-controls, aria-value* and tabindex; it adds the panels’ ids, tabindex="0" and their names from their first headings, and the handle’s name, when the markup leaves them out.

Methods

Method Behavior
PLF.Resizable.getOrCreateInstance(element, options) Returns the instance, creating it for valid markup. options sets orientation, sizes, minSizes, maxSizes (pairs) or stackAt, ahead of the attributes
PLF.Resizable.getInstance(element) Returns the instance or null
instance.setSizes([first, second]) Sets sizes that total 100, kept within the bounds. Returns false when unchanged, invalid, canceled or disabled
instance.getSizes() Returns [first, second]
instance.getState() Returns {sizes, minSizes, maxSizes, orientation, stackAt, stacked, disabled}
instance.destroy() Ends a drag, removes listeners and restores the attributes and styles the script set
Event When
plf:resizable:before-change Before the sizes change; cancelable
plf:resizable:change After the sizes change

Each event’s detail:

Property Value
instance The Resizable instance
reason api, keyboard or pointer
trigger The handle, or null from a method
previousSizes The sizes before the change, [first, second] in percent
sizes The new sizes, [first, second] in percent
Key Action
Left Arrow, Right Arrow Move a horizontal handle 1%
Up Arrow, Down Arrow Move a vertical handle 1%
Shift with an arrow Moves 10%
Home, End Shrink or grow the first panel to its bound
Escape During a drag, returns to the starting sizes

React

Resizable from @pelatform/react renders the two panels and the handle with the names and ARIA the script adds, and moves the handle with a drag or the keys: it keeps the first panel’s size, or the application sets it with size, and each part is a component of its own.

Prop Values Default
size The first panel’s size in percent, which the application changes in onSizeChange; keeping it refuses the move Its own state
defaultSize The first panel’s starting size when the application does not set size; the second panel takes the rest 50
onSizeChange (size), called when a drag or a key moves the handle None
minSize, maxSize The first panel’s bounds in percent; the second panel’s follow from them 15 and 85
orientation horizontal, vertical horizontal
stackAt The width in pixels below which the panels stack and the handle hides; 0 never stacks 480
Part Element
ResizablePanel A section with resizable-panel, the first and the last child, named by its first heading written as an element, such as <h3>, unless given aria-label or aria-labelledby
ResizableHandle A div with resizable-handle between the panels, named after the first panel unless given a name
ResizableGrip A span with resizable-grip, which draws the grip; an Icon inside takes its place

The other props are the element’s own, className and ref included; aria-disabled="true" on Resizable, or a disabled fieldset around it, blocks resizing.

Variable Default
--plf-resizable-height 24rem (384px)
--plf-resizable-panel-padding Space 4, 1rem (16px)
--plf-resizable-handle-thickness 24px
--plf-resizable-icon-size --plf-control-icon-size (16px)
--plf-resizable-border Subtle border
--plf-resizable-radius --plf-radius-lg, 0.5rem (8px)
--plf-resizable-bg Transparent
--plf-resizable-handle-color Muted text

Built with Pelatform UIv0.1.0

Components

Getting started

Foundations

Components

Actions

Data display

Navigation

Feedback

Data input

Layout

Advanced

Integrations

Blocks

Application

Authentication

Icons