import { KbqResizerModule } from '@koobiq/components/resizer';

KbqResizable

directiveCopy link to KbqResizable

Directive (container) sets whether the element is resizable.

Example
<div kbqResizable>
    <div [kbqResizer]="[-1, 0]"></div>
</div>
@Directive({ selector: '[kbqResizable]', exportAs: 'kbqResizable' })
class KbqResizable {}

KbqResizer

directiveCopy link to KbqResizer

Directive which defines element resizing direction.

@Directive({ selector: '[kbqResizer]', exportAs: 'kbqResizer' })
class KbqResizer {
    readonly direction = input.required<KbqResizerDirection>({
        alias: 'kbqResizer'
    });
    readonly cursor = input<string | null>(null);
    readonly disableSizeUpdate = input<boolean>(false);
    readonly resizeStart = output<KbqResizerSizeChangeEvent>();
    readonly sizeChange = output<KbqResizerSizeChangeEvent>();
}
kbqResizerinputrequiredCopy link to kbqResizerKbqResizerDirection

Direction of element resizing.

cursorinputCopy link to cursorstring | null

Overrides the cursor that is otherwise derived from the resizing direction.

disableSizeUpdateinputCopy link to disableSizeUpdateboolean

Stops the directive from writing the new size onto the resizable element, leaving the host in control: resizeStart and sizeChange still report the size the drag asks for, and the host decides what to apply. Use it when the element's size is owned by a layout the directive must not fight — KbqSplitter sizes its panels through a grid template on their common parent.

The reported size stays measured from where the drag started rather than from the element, so a host that clamps or ignores a move does not accumulate drift over the rest of the drag.

resizeStartoutputCopy link to resizeStartKbqResizerSizeChangeEvent

Emits the element size when a pointer drag begins, after the directive has committed to the resize.

sizeChangeoutputCopy link to sizeChangeKbqResizerSizeChangeEvent

Emits the new size of the element after resizing.

KbqResizerDirection

typeCopy link to KbqResizerDirection

Directions for resizing.

Horizontal direction (x):

  • Left: -1
  • None: 0
  • Right: 1

Vertical direction (y):

  • Up: -1
  • None: 0
  • Down: 1
type KbqResizerDirection = [x: -1 | 0 | 1, y: -1 | 0 | 1];

KbqResizerSizeChangeEvent

typeCopy link to KbqResizerSizeChangeEvent

Event emitted when the size of the resizable element changes.

type KbqResizerSizeChangeEvent = {
    width: number;
    height: number;
};
Suggestions for improvement
If you found a mistake or want to improve the article, create an issue on GitHub.