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

customizable-react-modal-by-lazez

v0.3.6

Published

customizable modal by lazez

Downloads

33

Readme

A modal React component, customize it with your favorite colors!

About

Simple component for React project. Keep the default theme or chose your colors simply.

Installation

You can install this component with npm or yarn:

npm i customizable-react-modal-by-lazez

or

yarn add customizable-react-modal-by-lazez

caution

You'll perhaps have to do npm start or yarn start again
so that it works in your project (it'll be opened in another port then)

NPM link

customizable react modal by lazez on NPM

Use in your React project

Import the Modal component into the file

import { Modal } from customized-react-modal-lazez

Example ( in a React project)

App.js

import { useState } from "react";
import "./App.css";
import { Modal } from "customizable-react-modal-by-lazez";

function App() {
  // Set here your own colors or keep  my theme if you like it
  const myTheme = {
    containerBg: "rgba(146, 146, 96, 1)",
    messageBg: "#444444",
    messageHoverBg: "#aebf8e",
    messageHoverTxt: "black",
    borderColor: "#d5db99",
    buttonBg: "#d5db99",
    buttonHoverBg: "#444444",
    buttonHoverTxt: "white",
  };

  //to open and close Modal
  const [openModal, setOpenModal] = useState(false);
  const onOpenModal = () => setOpenModal(true);
  const onCloseModal = () => setOpenModal(false);
  const handleSubmit = (e) => {
    e.preventDefault();
    onOpenModal();
  };

  return (
    <div className="App">
      <form onSubmit={handleSubmit}>
        <button type="submit" className="submit">
          Clic to open Modal
        </button>
      </form>

      {openModal && (
        <Modal
          theme={myTheme}
          close={onCloseModal}
          text="Write here whatever you want!"
        />
      )}
    </div>
  );
}

export default App;

App.css

.App {
  width: 100vw;
  height: 100vh;
  margin: auto;
  text-align: center;
  background-color: black;
}
.submit {
  width: 12rem;
  margin-top: 16.5rem;
  background-color: white;
  padding: 1.5rem;
  border-radius: 2rem;
}

Want to see what it's like?

Live

Demo on Netlify

Screenshots

demo1

demo2