0.0.5 • Published 3 years ago

@bipboys/squircle v0.0.5

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

ts license

Description

React component for create Superellipse (or Squircle) mask using svg and css mask-image attribute.

Installation

npm install @bipboys/squircle

Usage

It couldn't be easier!

import Squircle from "@bipboys/squircle";

<Squircle style={{ width: 64, height: 64 }}>{/* <img /> */}</Squircle>;

Props

proptypedefaultdescription
ratio1number0.05860 ~ 0.5 width ratio
ratio2number0.3320 ~ 0.5 width ratio
pixelRatio1number0 ~ width/2 in pixel
pixelRatio2number0 ~ width/2 in pixel
childrenReactNodeex.: image, etc.