Twitter2.2k

Resizable

A group of resizable horizontal and vertical panels.

One
Two
Three

Installation

npx nx g @spartan-ng/cli:ui resizable

Usage

import { HlmResizableImports } from '@spartan-ng/helm/resizable';
<hlm-resizable-group class="h-[200px] w-[500px] max-w-md rounded-lg border">
			<hlm-resizable-panel>
				<div class="flex h-full items-center justify-center p-6">One</div>
			</hlm-resizable-panel>
			<hlm-resizable-handle />
			<hlm-resizable-panel>
				<hlm-resizable-group direction="vertical">
					<hlm-resizable-panel>
						<div class="flex h-full items-center justify-center p-6">
							<span class="font-semibold">Two</span>
						</div>
					</hlm-resizable-panel>
					<hlm-resizable-handle />
					<hlm-resizable-panel>
						<div class="flex h-full items-center justify-center p-6">
							<span class="font-semibold">Three</span>
						</div>
					</hlm-resizable-panel>
				</hlm-resizable-group>
			</hlm-resizable-panel>
		</hlm-resizable-group>

Examples

Vertical

Use the direction prop to set the direction of the resizable panels.

Header
Content

Handle

You can set or hide the handle by using the withHandle prop on the hlm-resizable-handle component.

Sidebar
Content

Brain API

BrnResizableGroup

Selector: brn-resizable-group, [brnResizableGroup]

ExportAs: brnResizableGroup

Inputs

PropTypeDefaultDescription
id string `brn-resizable-group-${++nextId}` The id of the BrnResizableGroup
direction 'horizontal' | 'vertical' horizontal Group orientation
layout number[] [] Resize panel group to the specified layout ([1 - 100, ...]).

Outputs

PropTypeDefaultDescription
dragStart void - event when resize starts
dragEnd void - event when resize ends
layoutChanged number[] - Called when group layout changes
layoutChanged number[] [] Resize panel group to the specified layout ([1 - 100, ...]).

BrnResizableHandle

Selector: brn-resizable-handle, [brnResizeHandle]

ExportAs: brnResizableHandle

Inputs

PropTypeDefaultDescription
withHandle unknown false Whether a visual handle is rendered inside the separator.
disabled unknown false Whether the handle is disabled (not interactive).

BrnResizablePanel

Selector: brn-resizable-panel, [brnResizablePanel]

ExportAs: brnResizablePanel

Inputs

PropTypeDefaultDescription
id string `brn-resizable-panel-${++nextId}` Unique ID for the panel.
defaultSize unknown undefined The default size of the panel (percentage of container space). - `undefined` → group decides initial size. - Number → interpreted as percentage (0–100).
minSize unknown 0 The minimum size this panel can shrink to (percentage).
maxSize unknown 100 The maximum size this panel can grow to (percentage).
collapsible unknown true Whether this panel can be collapsed entirely.

Helm API

HlmResizableGroup

Selector: hlm-resizable-group

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmResizableHandle

Selector: hlm-resizable-handle

ExportAs: hlmResizableHandle

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmResizablePanel

Selector: hlm-resizable-panel

Inputs

PropTypeDefaultDescription
class ClassValue --
Scroll Area Radio Group