Twitter2.2k

Resizable

A group of resizable horizontal and vertical panels.

One
Two
Three

Installation

ng 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 boolean false Whether a visual handle is rendered inside the separator.
disabled boolean 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 number undefined The default size of the panel (percentage of container space). - `undefined` → group decides initial size. - Number → interpreted as percentage (0–100).
minSize number 0 The minimum size this panel can shrink to (percentage).
maxSize number 100 The maximum size this panel can grow to (percentage).
collapsible boolean true Whether this panel can be collapsed entirely.

Helm API

HlmResizableGroup

Selector: [hlmResizableGroup],hlm-resizable-group

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmResizableHandle

Selector: hlm-resizable-handle

ExportAs: hlmResizableHandle

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmResizablePanel

Selector: [hlmResizablePanel],hlm-resizable-panel

Inputs

PropTypeDefaultDescription
class ClassValue --
Scroll Area Radio Group