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

rockmodal

v1.3.7

Published

Modal by Ahmad Faisal

Readme

Rock Modal

A lightweight, customizable, and animated modal component for React that supports slide-in and slide-out effects, custom positions, and easy integration.

npm version downloads license

Features

  • Slide-in/slide-out effects: Supports slideInLeft, slideInRight, slideOutLeft, slideOutRight.
  • Custom positions: You can position the modal to the left, right, or center.
  • Color customization: Change the background color using predefined color names.
  • Responsive: Easily adjust the modal width based on percentage or custom values.
  • Close functionality: Close the modal by clicking outside or using the close button.

Installation

To install the rockmodal library, run the following command:

npm install rockmodal

This package would need sass, so after install rockmodal, please install sass by following this command


npm install sass

Usage

Importing the RockModal Component First, import the RockModal component from the rockmodal library:

import { RockModal } from "rockmodal";

Example Usage


Parent Code

import React, { useState } from "react";
import AddModal from "./pages/AddModal";

const App = () => {
  const [addModal, setAddModal] = useState(false);


  return (
    <div className="container mx-auto p-5">
      <div className="flex justify-between mb-3">
        <h1 className="text-3xl font-bold text-center text-gray-800">
          Table Data
        </h1>
        <button
          onClick={() => setAddModal(true)}
          className="bg-blue-500 hover:bg-blue-700 duration-300 text-white font-bold py-1 px-2 rounded"
        >
          Add
        </button>
      </div>
      <AddModal isOpen={addModal} onClose={() => setAddModal(false)} />
    </div>
  );
};

export default App;

Modal Code


import React from "react";
import RockModal from "../components/RockModal/RockModal";

const AddModal = ({ isOpen, onClose }) => {
  return (
    <RockModal
      isOpen={isOpen}
      onClose={onClose}
      effect="slideInRight"
      color="cyan"
      width="30"
      position="right"
    >
      <div className="flex justify-between p-4 min-h-screen">
        <h1 className="text-2xl font-semibold text-base">Choose Payment</h1>
      </div>
    </RockModal>
  );
};

export default AddModal;

Props

| Prop Name | Type | Description | Required | Default | | ---------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------ | -------- | -------- | | isOpen | Boolean | Controls the visibility of the modal. When set to true, the modal will appear. | Yes | false | | onClose | Function | A callback function that is triggered when the modal is closed. | Yes | null | | effect | String | Defines the animation effect for the modal. Available values are: slideInLeft slideInRight slideOutLeft slideOutRight. | Yes | center | | color | String | Background color of the modal. You can use standard color names or hex values. | No | white | | width | string | Width of the modal, defined in percentage (%). | No | 80% | | position | String | Position of the modal. Available values: left, right, center. If no value is provided, defaults to center. | No | center |

Color Lists

The color prop supports predefined named colors from the colorMap or any valid CSS color value. Below are the available color options in the colorMap:

| Color Name | RGB Code | | ---------- | ------------------ | | blue | rgb(0, 0, 255) | | red | rgb(255, 0, 0) | | green | rgb(0, 255, 0) | | yellow | rgb(255, 255, 0) | | orange | rgb(255, 165, 0) | | purple | rgb(128, 0, 128) | | pink | rgb(255, 192, 203) | | brown | rgb(165, 42, 42) | | grey | rgb(128, 128, 128) | | black | rgb(0, 0, 0) | | white | rgb(255, 255, 255) | | cyan | rgb(0, 255, 255) | | magenta | rgb(255, 0, 255) | | lime | rgb(0, 255, 0) | | maroon | rgb(128, 0, 0) | | navy | rgb(0, 0, 128) | | olive | rgb(128, 128, 0) | | teal | rgb(0, 128, 128) | | coral | rgb(255, 127, 80) | | salmon | rgb(250, 128, 114) | | khaki | rgb(240, 230, 140) | | gold | rgb(184, 134, 11) | | silver | rgb(192, 192, 192) | | crimson | rgb(220, 20, 60) | | indigo | rgb(75, 0, 130) | | violet | rgb(238, 130, 238) | | plum | rgb(221, 160, 221) | | beige | rgb(245, 245, 220) | | lavender | rgb(230, 230, 250) | | mint | rgb(189, 252, 201) |

there are lists of transparent color too, you just need to add Transparent after listed color e.g: blueTransparent, violetTransparent etc.