What is angular-resizable-element?
The angular-resizable-element package allows you to add resizable functionality to elements in your Angular applications. It provides a simple and flexible way to make any element resizable by dragging its edges or corners.
What are angular-resizable-element's main functionalities?
Basic Resizable Element
This feature allows you to make a basic element resizable by specifying the handles (e.g., 'right', 'bottom', 'corner') that can be dragged to resize the element.
<resizable [rzHandles]="['right', 'bottom', 'corner']">
<div class="box">
Resizable Element
</div>
</resizable>
Resizable with Minimum and Maximum Dimensions
This feature allows you to set minimum and maximum dimensions for the resizable element, ensuring that it cannot be resized beyond the specified limits.
<resizable [rzHandles]="['right', 'bottom', 'corner']" [rzMinWidth]="100" [rzMinHeight]="100" [rzMaxWidth]="500" [rzMaxHeight]="500">
<div class="box">
Resizable Element with Constraints
</div>
</resizable>
Resizable with Aspect Ratio
This feature allows you to maintain the aspect ratio of the resizable element, ensuring that the width and height are resized proportionally.
<resizable [rzHandles]="['right', 'bottom', 'corner']" [rzAspectRatio]="true">
<div class="box">
Resizable Element with Aspect Ratio
</div>
</resizable>
Other packages similar to angular-resizable-element
angular-gridster2
angular-gridster2 is a package that provides a grid layout system for Angular applications, allowing you to create resizable and draggable grid items. It offers more advanced grid-based layout features compared to angular-resizable-element, making it suitable for complex dashboard layouts.
ngx-resizable
ngx-resizable is another Angular package that provides resizable functionality for elements. It offers similar features to angular-resizable-element, such as customizable handles and constraints, but with a different API and implementation.
angular-split
angular-split is a package that allows you to create resizable split views in Angular applications. It is specifically designed for creating resizable panels or splitters, making it a good choice for applications that require a split view layout.
angular resizable element

Demo
https://mattlewis92.github.io/angular-resizable-element/
Table of contents
About
An angular 15.0+ directive that allows an element to be dragged and resized
Installation
Install through npm:
npm install angular-resizable-element
Then use it in your app like so:
import { Component } from '@angular/core';
import { ResizeEvent } from 'angular-resizable-element';
@Component({
selector: 'demo-app',
styles: [
`
.rectangle {
position: relative;
top: 200px;
display: flex;
align-items: center;
justify-content: center;
width: 300px;
height: 150px;
background-color: #fd4140;
border: solid 1px #121621;
color: #121621;
margin: auto;
}
mwlResizable {
box-sizing: border-box; // required for the enableGhostResize option to work
}
.resize-handle-top,
.resize-handle-bottom {
position: absolute;
height: 5px;
cursor: row-resize;
width: 100%;
}
.resize-handle-top {
top: 0;
}
.resize-handle-bottom {
bottom: 0;
}
.resize-handle-left,
.resize-handle-right {
position: absolute;
height: 100%;
cursor: col-resize;
width: 5px;
}
.resize-handle-left {
left: 0;
}
.resize-handle-right {
right: 0;
}
`,
],
template: `
<div
class="rectangle"
mwlResizable
[enableGhostResize]="true"
(resizeEnd)="onResizeEnd($event)"
>
<div
class="resize-handle-top"
mwlResizeHandle
[resizeEdges]="{ top: true }"
></div>
<div
class="resize-handle-left"
mwlResizeHandle
[resizeEdges]="{ left: true }"
></div>
<div
class="resize-handle-right"
mwlResizeHandle
[resizeEdges]="{ right: true }"
></div>
<div
class="resize-handle-bottom"
mwlResizeHandle
[resizeEdges]="{ bottom: true }"
></div>
</div>
`,
})
export class MyComponent {
onResizeEnd(event: ResizeEvent): void {
console.log('Element was resized', event);
}
}
import { NgModule } from '@angular/core';
import { ResizableModule } from 'angular-resizable-element';
@NgModule({
declarations: [MyComponent],
imports: [ResizableModule],
bootstrap: [MyComponent],
})
class MyModule {}
You may also find it useful to view the demo source.
Documentation
All documentation is auto-generated from the source and can be viewed here:
https://mattlewis92.github.io/angular-resizable-element/docs/
Development
Prepare your environment
Development server
Run pnpm start
to start a development server on port 8000 with auto reload + tests.
Testing
Run pnpm test
to run tests once or pnpm test:watch
to continually run tests.
Release
pnpm release
License
MIT