CxJS

Resizer

import { Resizer } from 'cx/widgets'; Copied

The Resizer component is a draggable divider that allows users to resize adjacent elements. Place it between two sibling elements to enable resizing. Double-click to reset to the default size.

<div className="flex h-[150px] border border-gray-300">
  <div className="p-4" style={{ width: format(m.leftWidth, "n;0:suffix;px") }}>
    Left panel (drag the resizer)
  </div>
  <Resizer
    size={m.leftWidth}
    minSize={100}
    maxSize={400}
    className="border-x border-gray-300"
  />
  <div className="flex-1 p-4">Right panel</div>
</div>
Left panel (drag the resizer)
Right panel

Configuration

PropertyTypeDescription
sizenumberA binding for storing the resized element’s size.
defaultSizenumberValue set when the user double-clicks the resizer.
minSizenumberMinimum allowed size. Default is 0.
maxSizenumberMaximum allowed size. Default is 1000000.
horizontalbooleanSet to true for horizontal resizing (row-resize). Default is false (vertical, col-resize).
forNextElementbooleanUse the element after the resizer for size measurements instead of before. Default is false.
baseClassstringBase CSS class. Default is resizer.