Socket
Socket
Sign inDemoInstall

ember-resizable

Package Overview
Dependencies
393
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ember-resizable

Resizable component for Ember.


Version published
Weekly downloads
73
decreased by-35.4%
Maintainers
2
Created
Weekly downloads
 

Changelog

Source

[3.0.1] - 2023-01-16

Changed

  • Add @ember/string as a dependency to fix Ember 4.10+ deprecation warnings

Readme

Source

Build Status Ember Observer Score npm version

ember-resizable

Resizable component for Ember. (Demo)

This is largely inspired by/based on re-resizable.

Compatibility

  • Ember.js v3.28 or above
  • Ember CLI v3.28 or above
  • Node.js v14 or above

Installation

ember install ember-resizable

Usage

Include the following in your app.scss:

@import 'ember-resizable';

Basic usage:

<ReSizable @width="300" @height="200">
  Your Content
</ReSizable>

This will make <ReSizable> adjust its size according to user input. If you want to manually control its size, bind to onResize while not setting width and height. Manually setting width, height between resizes is of course also possible.

Properties

PropertydefaultTypeNotes
widthnullint or stringInitial size. If provided the component will adjust its size according to user input. If omitted or null it will not change its size. This is a one way binding nevertheless.
heightnullint or stringInitial size. If provided the component will adjust its size according to user input. If omitted or null it will not change its size. This is a one way binding nevertheless.
minWidth10intMinimum width in pixels
minHeight10intMinimum height in pixels
maxWidthintMaximum width in pixels
maxHeightintMaximum height in pixels
grid[1, 1]array: intUsed for snapping on x, y axis. If set to [200, 50] for example, width will snap to 0, 200, 400, 600, … while height will snap to 0, 50, 100, 150, …
lockAspectRatiofalseboolMaintain aspect ratio that is found during beginning of resize
directions['top', 'right', 'bottom', 'left', 'topRight', 'bottomRight', 'bottomLeft', 'topLeft']array: stringOn which sides/corners to enable resizing

Actions

NameParamsNote
onResizeStartdirection, event, elementelement is the <ReSizable> DOM element
onResizeStopdirection, { width: deltaX, height: deltaY }, elementIf you did not adjust the size of <ReSizable> by changing its dimension and if you did not provide width/height using for e.g. the values provided by onResize deltaX and deltaY will be 0
onResizedirection, { width: newWidth, height: newHeight }, { width: deltaX, height: deltaY }, element.

In addition it is possible to adjust the size of the resize handlers in your scss:

// 10px is the default size
$ember-resizable-resizer-size: 10px;

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Keywords

FAQs

Last updated on 16 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc