npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-peel

v0.1.3

Published

react-peel is a react library to create realistic peeling effects. No dependencies.

Downloads

176

Readme

React Peel

Important Note: This is the first release of the library, so if you encounter any issues, please submit them. Your feedback is greatly appreciated. Contributors are also welcome!

react-peel is a React library that serves as a wrapper around the peel.js library created by Andrew Plummer.

The library allows you to create realistic peeling effects in your React applications. It comes with a set of props and events to customize and control the peeling behavior.

Check out the docs at https://react-peel.vercel.app

Installation

To install react-peel in your project, use the following command:

npm install react-peel

Basic usage

import React from "react";
import { PeelWrapper, PeelTop, PeelBottom, PeelBack } from "react-peel";

const MyComponent = () => {
  return (
    <PeelWrapper height={200} width={200} drag>
      <PeelTop style={{ backgroundColor: "#81afcb" }}></PeelTop>
      <PeelBack style={{ backgroundColor: "#a0c7df" }}></PeelBack>
      <PeelBottom style={{ backgroundColor: "#688394" }}></PeelBottom>
    </PeelWrapper>
  );
};

export default MyComponent;

This basic example demonstrates how to set up a peel effect using react-peel. You can customize the appearance, size, and behavior of the peel by adjusting the props and styles passed to the components within the PeelWrapper.

PeelWrapper Props

The PeelWrapper component provides the following props to customize the peeling effect:

| Props | Type | Note | | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ref | MutableRefObject<any> \| undefined | Reference to the Peel object, containing values and methods. | | className | string \| undefined | Represents the class of PeelWrapper. | | height | string \| undefined | Sets the height of PeelWrapper. | | width | string \| undefined | Sets the width of PeelWrapper. | | options | object \| undefined | Options to pass to the underlying peel.js constructor. See options here. | | peelPosition | { x: number, y: number } \| undefined | The position of the peel effect. This point is the position of the corner that is being peeled back. | | corner | { x: number, y: number } \| "TOP_LEFT" \| "TOP_RIGHT" \| "BOTTOM_LEFT" \| "BOTTOM_RIGHT" \| undefined | The corner for the effect to peel back from. Can be 2 arguments as x,y coordinates or a single argument as a corner name. Default is the bottom right corner. | | constraints | { x: number, y: number } \| "TOP_LEFT" \| "TOP_RIGHT" \| "BOTTOM_LEFT" \| "BOTTOM_RIGHT" \| undefined \| Array<{ x: number, y: number } \| "TOP_LEFT" \| "TOP_RIGHT" \| "BOTTOM_LEFT" \| "BOTTOM_RIGHT" \| undefined> | List of constraints on the distance of the peel. Can be 2 arguments as x,y coordinates or a single argument as a corner name. | | drag | boolean \| undefined | A shorthand for setting the @drag event to set the peel position to the mouse. | | mode | "book" \| "calendar" \| undefined | A shortcut for setting predefined constraints. Currently "book" and "calendar". | | fadeThreshold | number \| undefined | A threshold above which the top layer will begin to fade out. The threshold is between 0 (no peel) and 1 (top layer is fully peeled off). | | timeAlongPath | number \| undefined | Sets the peel effect to a point in time (between 0 and 1) along a previously specified path. Will throw an error if no path exists. | | peelPath | number[] \| undefined | A path along which the peel will follow. This can be a flat line segment or a bezier curve. |

Contribution

Contributions are welcome! Feel free to check out the Contributing Guide before making a pull request.