Skip to content

Add a blurred background to image to fit it to required dimensions without disturbing its aspect ratio.

Notifications You must be signed in to change notification settings

shreya0712/squarify-image

Repository files navigation

Build Status MIT License Contributors LinkedIn

Squarify Image

Easy to use image component where the image takes up entire height and width of the containing element, while maintaining its aspect ratio by filling up extra space with blurred background.

Getting Started

Prerequisites

Following Peer Dependency is required for using this library:

  • react: ^16.12.0

Installation

npm install @tarragon/squarify-image --save

or

yarn add @tarragon/squarify-image

Usage

Example

Checkout the basic usage here.

Quick Usage

Make sure to use the component within a container element whose dimensions shall be inherited by the image.

<div className="img-container">
  <Squarify image={url} />
</div>

Import the Squarify component and pass the href property for the image.

Built With

License

Distributed under the MIT License. See LICENSE for more information.

About

Add a blurred background to image to fit it to required dimensions without disturbing its aspect ratio.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published