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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-curved-div

v0.0.3

Published

A simple react component to create a curved div

Readme

BentRectangle Component

The BentRectangle component is a customizable React component that renders a rectangle with bent edges. It supports various configurations for corner radii, edge bending, and styling, making it highly versatile for creating unique UI elements.

Bent Div

Installation

To install the package, use npm or yarn:

npm install react-curved-div

Checkout Some Examples Live On Website.

Usage

Import the BentRectangle component into your React project:

import React from "react";
import { BentRectangle } from "react-curved-div";

const App = () => (
  <BentRectangle
    topLeftCornerRadius={10}
    topRightCornerRadius={10}
    bottomLeftCornerRadius={20}
    bottomRightCornerRadius={20}
    topBendPercent={10}
    bottomBendPercent={15}
    leftBendPercent={5}
    rightBendPercent={5}
    bendDirection="outward"
    className="custom-shape"
    style={{ backgroundColor: "lightblue" }}
    contentClassName="custom-content"
    contentStyle={{ padding: "20px" }}
    isFullWidthOfParent={true}
    isFullHeightOfParent={true}
  >
    <p>This is a bent rectangle with custom styles and content.</p>
  </BentRectangle>
);

export default App;

Props

Corner Radius

  • topLeftCornerRadius (number): Radius for the top-left corner of the shape (in pixels). Default is 0.
  • topRightCornerRadius (number): Radius for the top-right corner of the shape (in pixels). Default is 0.
  • bottomLeftCornerRadius (number): Radius for the bottom-left corner of the shape (in pixels). Default is 0.
  • bottomRightCornerRadius (number): Radius for the bottom-right corner of the shape (in pixels). Default is 0.

Edge Bending

  • topBendPercent (number): Percentage of the width to bend the top edge of the shape. Values should be between 0 and 100. Default is 0.
  • bottomBendPercent (number): Percentage of the width to bend the bottom edge of the shape. Values should be between 0 and 100. Default is 0.
  • leftBendPercent (number): Percentage of the height to bend the left edge of the shape. Values should be between 0 and 100. Default is 0.
  • rightBendPercent (number): Percentage of the height to bend the right edge of the shape. Values should be between 0 and 100. Default is 0.

Content and Styling

  • children (React.ReactNode): React children to be rendered inside the shape.
  • className (string): Additional class name(s) to apply to the shape container. Default is an empty string.
  • style (React.CSSProperties): Inline styles to apply to the shape container. Excludes properties related to positioning and layout.
  • contentClassName (string): Additional class name(s) to apply to the content inside the shape. Default is an empty string.
  • contentStyle (React.CSSProperties): Inline styles to apply to the content inside the shape. Excludes properties related to masking, positioning, and overflow.

Layout

  • isFullWidthOfParent (boolean): Whether the shape should take the full width of its parent container. Default is false.
  • isFullHeightOfParent (boolean): Whether the shape should take the full height of its parent container. Default is false.

Bending Direction

  • bendDirection ("inward" | "outward"): Direction of the bend for the edges of the shape. Can be either "inward" or "outward". Default is "inward".

Behavior

  • The component uses ResizeObserver to dynamically adjust the size of the shape based on its container or parent dimensions.
  • The bending percentages are converted into pixel values based on the container's size.
  • The shape is rendered using an SVG path and mask, allowing for precise control over its appearance.

Example Images

Below are some example images showcasing the BentRectangle component you can use for:

  1. Inward Bending: Inward Bending Example

  2. Outward Bending: Outward Bending Example

Notes

  • Ensure that the parent container has a defined size if using isFullWidthOfParent or isFullHeightOfParent.
  • The component is responsive and adjusts dynamically to changes in its container or parent dimensions.

License

This project is licensed under the MIT License.