Resizable
A Brutalist resizable split-panel layout with 5px base corners, 2px black borders, hard 4px shadows, and collapsible stops.
A Brutalist resizable panel group styled with 5px (rounded-base) corners, 2px black borders, zero-blur 4px 4px offset shadows, and DM Sans typography, with borderless nested composition via variant="nested".
Preview
Section titled “Preview”<proto-ui-brutalist-resizable-root
id="brutalist-resizable-hero"
class="h-56 w-full max-w-md"
>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">One</span>
</div>
</proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-handle></proto-ui-brutalist-resizable-handle>
<proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-root
id="brutalist-resizable-nested"
class="h-full w-full min-h-0"
>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Two</span>
</div>
</proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-handle></proto-ui-brutalist-resizable-handle>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Three</span>
</div>
</proto-ui-brutalist-resizable-panel>
</proto-ui-brutalist-resizable-root>
</proto-ui-brutalist-resizable-panel>
</proto-ui-brutalist-resizable-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#brutalist-resizable-hero');
const nestedRoot = document.querySelector(
'#brutalist-resizable-nested'
);
setElementProps(root, {
defaultSizes: [50, 50],
constraints: [
{ min: 20, max: 75, collapsible: true },
{ min: 25 },
],
});
setElementProps(nestedRoot, {
orientation: 'vertical',
defaultSizes: [25, 75],
constraints: [{ min: 20 }, { min: 25 }],
variant: 'nested',
});
root
.querySelectorAll(':scope > proto-ui-brutalist-resizable-panel')
.forEach((panel, index) => setElementProps(panel, { index }));
setElementProps(
root.querySelector(
':scope > proto-ui-brutalist-resizable-handle'
),
{ index: 0, withHandle: true }
);
nestedRoot
.querySelectorAll(':scope > proto-ui-brutalist-resizable-panel')
.forEach((panel, index) => setElementProps(panel, { index }));
setElementProps(
nestedRoot.querySelector(
':scope > proto-ui-brutalist-resizable-handle'
),
{ index: 0, withHandle: true }
);
</script>Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases. Import the prototypes directly from @proto.ui/prototypes-brutalist/resizable and adapt them for your target runtime:
import { resizableRoot, resizablePanel, resizableHandle,} from '@proto.ui/prototypes-brutalist/resizable';import { BrutalistResizableRoot, BrutalistResizablePanel, BrutalistResizableHandle,} from '../proto-ui/components/react';
export function Example() { return ( <BrutalistResizableRoot defaultSizes={[50, 50]} className="h-56 w-full max-w-md"> <BrutalistResizablePanel index={0}>One</BrutalistResizablePanel> <BrutalistResizableHandle index={0} withHandle /> <BrutalistResizablePanel index={1}>Two</BrutalistResizablePanel> </BrutalistResizableRoot> );}Composition
Section titled “Composition”BrutalistResizableRoot (variant="default" | "nested")├── BrutalistResizablePanel (index: 0)├── BrutalistResizableHandle (index: 0, withHandle?)└── BrutalistResizablePanel (index: 1)- Top-level
Rootrenders therounded-base2px black frame and 4px hard shadow by default; passvariant="nested"on inner split groups to keep them borderless and shadowless. - Place
NPanelparts (index: 0..N-1) andN - 1Handleparts (index: 0..N-2). Each panel exposes--pui-sizefor staticflex-basissizing. Handlepaints a 2px black divider with directional resize cursors; enablewithHandleto show an accent-filled, black-bordered grip badge.- Supports pointer drag, arrow keys,
Shift10× steps,Home/End, andEntercollapsing. Passsizesfor controlled mode and handlesizesChange/sizesCommit.
Examples
Section titled “Examples”Vertical
Section titled “Vertical”Set orientation="vertical" to resize stacked panes.
<proto-ui-brutalist-resizable-root
id="brutalist-resizable-vertical"
class="h-56 w-full max-w-md"
>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Header</span>
</div>
</proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-handle></proto-ui-brutalist-resizable-handle>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Content</span>
</div>
</proto-ui-brutalist-resizable-panel>
</proto-ui-brutalist-resizable-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector(
'#brutalist-resizable-vertical'
);
setElementProps(root, {
orientation: 'vertical',
defaultSizes: [25, 75],
constraints: [{ min: 20 }, { min: 25 }],
});
root
.querySelectorAll('proto-ui-brutalist-resizable-panel')
.forEach((panel, index) => setElementProps(panel, { index }));
setElementProps(
root.querySelector('proto-ui-brutalist-resizable-handle'),
{ index: 0 }
);
</script>Handle
Section titled “Handle”Compare the accent-bordered withHandle grip badge with the default 2px black divider.
<div class="flex w-full max-w-md flex-col gap-4">
<proto-ui-brutalist-resizable-root
id="brutalist-resizable-with-handle"
class="h-40 w-full max-w-md"
>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Sidebar</span>
</div>
</proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-handle></proto-ui-brutalist-resizable-handle>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Content</span>
</div>
</proto-ui-brutalist-resizable-panel>
</proto-ui-brutalist-resizable-root>
<proto-ui-brutalist-resizable-root
id="brutalist-resizable-hairline"
class="h-32 w-full max-w-md"
>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Left</span>
</div>
</proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-handle></proto-ui-brutalist-resizable-handle>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Right</span>
</div>
</proto-ui-brutalist-resizable-panel>
</proto-ui-brutalist-resizable-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const withGrip = document.querySelector(
'#brutalist-resizable-with-handle'
);
setElementProps(withGrip, {
defaultSizes: [25, 75],
constraints: [{ min: 15 }, { min: 30 }],
});
withGrip
.querySelectorAll('proto-ui-brutalist-resizable-panel')
.forEach((panel, index) => setElementProps(panel, { index }));
withGrip
.querySelectorAll('proto-ui-brutalist-resizable-handle')
.forEach((handle, index) =>
setElementProps(handle, { index, withHandle: true })
);
const hairline = document.querySelector(
'#brutalist-resizable-hairline'
);
setElementProps(hairline, {
defaultSizes: [50, 50],
constraints: [{ min: 20 }, { min: 20 }],
});
hairline
.querySelectorAll('proto-ui-brutalist-resizable-panel')
.forEach((panel, index) => setElementProps(panel, { index }));
setElementProps(
hairline.querySelector('proto-ui-brutalist-resizable-handle'),
{ index: 0, withHandle: false }
);
</script>Use direction="rtl" to mirror panel order and horizontal arrow-key behavior.
<proto-ui-brutalist-resizable-root
id="brutalist-resizable-rtl"
class="h-56 w-full max-w-md"
>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">واحد</span>
</div>
</proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-handle></proto-ui-brutalist-resizable-handle>
<proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-root
id="brutalist-resizable-rtl-nested"
class="h-full w-full min-h-0"
>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">اثنان</span>
</div>
</proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-handle></proto-ui-brutalist-resizable-handle>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">ثلاثة</span>
</div>
</proto-ui-brutalist-resizable-panel>
</proto-ui-brutalist-resizable-root>
</proto-ui-brutalist-resizable-panel>
</proto-ui-brutalist-resizable-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#brutalist-resizable-rtl');
const nestedRoot = document.querySelector(
'#brutalist-resizable-rtl-nested'
);
setElementProps(root, {
direction: 'rtl',
defaultSizes: [50, 50],
constraints: [{ min: 20 }, { min: 20 }],
});
setElementProps(nestedRoot, {
orientation: 'vertical',
direction: 'rtl',
defaultSizes: [25, 75],
constraints: [{ min: 20 }, { min: 25 }],
variant: 'nested',
});
root
.querySelectorAll(':scope > proto-ui-brutalist-resizable-panel')
.forEach((panel, index) => setElementProps(panel, { index }));
setElementProps(
root.querySelector(
':scope > proto-ui-brutalist-resizable-handle'
),
{ index: 0, withHandle: true }
);
nestedRoot
.querySelectorAll(':scope > proto-ui-brutalist-resizable-panel')
.forEach((panel, index) => setElementProps(panel, { index }));
setElementProps(
nestedRoot.querySelector(
':scope > proto-ui-brutalist-resizable-handle'
),
{ index: 0, withHandle: true }
);
</script>Multi-panel & Collapsible
Section titled “Multi-panel & Collapsible”Combine defaultSizes and constraints for a three-pane layout. Focus the first handle and press Enter to toggle the collapsible sidebar.
<proto-ui-brutalist-resizable-root
id="brutalist-resizable-collapsible"
class="h-56 w-full max-w-2xl"
>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Sidebar</span>
</div>
</proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-handle></proto-ui-brutalist-resizable-handle>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Editor</span>
</div>
</proto-ui-brutalist-resizable-panel>
<proto-ui-brutalist-resizable-handle></proto-ui-brutalist-resizable-handle>
<proto-ui-brutalist-resizable-panel>
<div class="flex h-full items-center justify-center p-6">
<span class="font-semibold text-sm">Inspector</span>
</div>
</proto-ui-brutalist-resizable-panel>
</proto-ui-brutalist-resizable-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector(
'#brutalist-resizable-collapsible'
);
setElementProps(root, {
defaultSizes: [25, 50, 25],
constraints: [
{ min: 15, max: 35, collapsible: true },
{ min: 30 },
{ min: 15, max: 35 },
],
});
root
.querySelectorAll('proto-ui-brutalist-resizable-panel')
.forEach((panel, index) => setElementProps(panel, { index }));
root
.querySelectorAll('proto-ui-brutalist-resizable-handle')
.forEach((handle, index) =>
setElementProps(handle, { index, withHandle: true })
);
</script>| Prop | Type | Default |
|---|---|---|
variant | 'default' 'nested' | 'default' |
sizes | readonly number[] | — |
defaultSizes | readonly number[] | — |
constraints | readonly ResizablePanelConstraint[] | [] |
value | number | — |
defaultValue | number | 50 |
min | number | 10 |
max | number | 90 |
step | number | 1 |
collapsible | boolean | false |
disabled | boolean | false |
readOnly | boolean | false |
orientation | 'horizontal' 'vertical' | 'horizontal' |
direction | 'ltr' 'rtl' | 'ltr' |
Panel & Handle
Section titled “Panel & Handle”| Prop | Type | Default |
|---|---|---|
Panel.index | number | 0 |
Handle.index | number | 0 |
Handle.withHandle | boolean | false |
- Exposed states: Root exposes
valueandsizes; Panel exposessize; Handle exposesvalue,focusVisible, anddisabled. - Events & methods: Root emits
sizesChange,sizesCommit,valueChange, andvalueCommit, and exposesrequestResize(index, next, commit?),requestSizes(next, commit?),requestValue(next, commit?), andcancelResize().