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

popkit

v1.5.4

Published

![App Screenshot](https://i.ibb.co/mymdf3h/popkit-cover-2.png)

Downloads

10

Readme

PopKit! 🎉

App Screenshot

Introducing PopKit, the essential React library for crafting captivating popups, modals, toasts, and alerts. 🚀 Seamlessly integrate polished and responsive components into your React applications. PopKit streamlines development, empowering you to prioritize flawless user experiences. 🔧 Elevate your React app effortlessly with PopKit today.

Features

  • 🎉 Easily integrate captivating popups, modals, toasts, and alerts into your React applications.
  • 🛠️ Streamline development with polished and responsive components.
  • 🚀 Elevate user experiences effortlessly.
  • 🔧 Hassle-free implementation for flawless user interactions.
  • 💡 The easiest UI library available.
  • 👌 Simplify the process of adding engaging UI elements.
  • 🌟 Empower developers to craft captivating user interfaces.
  • 💬 Enhance user engagement with interactive alerts and notifications.
  • 🔔 Seamlessly manage popups and alerts for a smoother user journey.
  • 🎨 Customize and tailor UI elements to match your brand's aesthetic.
  • 💼 Boost productivity with the easiest React library for UI enhancements.
  • Dark mode 🌒
  • And much more !

Installation

Using NPM : 👇

  npm install popkit

Using Yarn : 👇

  yarn add popkit

Add Styles : 👇

import "popkit/dist/style.css";

If you're using Next.js, simply add this code snippet inside either _app.js (if you're using page routing) or layout.jsx (for app routing)

Usage / Examples

Alert Popup 👇

Alert Popup

import React, { useState } from "react";

import { AlertPopup } from "popkit";
import "popkit/dist/style.css"; //Important for Styling

function Example() {
  const [modal, setModal] = useState(false);

  const handlePopup = () => {
    setModal(true);
  };
  return (
    <>
      <button onClick={handlePopup}>Trigger Popkit!</button>
      <AlertPopup
        title="Mission Accomplished! 🏆"
        description="Congratulations! You've successfully completed your task. Our success popups celebrate your achievements and victories!🚀"
        variant="success"
        open={modal}
        setOpen={() => {
          setModal(!modal);
        }}
        onConfirm={() => {
          /*redirect somewhere*/
        }}
        crossButton={true}
        buttonsText={["First Button Text", "Second Button Text"]} // !NOTE: don't add more than 2 elements or else it'll break
        isDark={true} // {true} -> means dark theme, {false} -> means light theme
      />
    </>
  );
}

export default Example;

Popup With Image 👇

Popup

import React, { useState } from "react";
import { Popup } from "popkit";
import "popkit/dist/style.css"; //Important for Styling

function Popkit() {
  const [modal, setModal] = useState(false);

  const handlePopup = () => {
    setModal(true);
  };
  return (
    <>
      <button onClick={handlePopup}>Trigger Popkit!</button>
      <Popup
        title="Mission Accomplished! 🏆"
        description="Astronauts landed on the moon successfully. Stay tuned as our team delves into the historic lunar landing achievements.🚀"
        buttonColor={"DC6803"} //add hexcode without hashtag (#)
        img={
          "https://img.freepik.com/premium-photo/ai-enhances-our-understanding-cosmos-by-analyzing-vast-amounts-data-collected-by-telescopes-probes-generated-by-ai_727385-1872.jpg?w=900"
        }
        crossButton={true} // wether you need a cross button on top left corner or not
        buttonsText={["First Button Text", "Second Button Text"]} // !NOTE: don't add more than 2 elements or else it'll break
        isDark={true} // {true} -> means dark theme, {false} -> means light theme
        open={modal}
        setOpen={() => {
          setModal(!modal);
        }}
        onConfirm={() => {
          /*redirect somewhere*/
        }}
      />
    </>
  );
}

export default Popkit;

Newsletter Popup 👇

Popup

import React, { useState } from "react";
import { NewsletterPopup } from "popkit";
import "popkit/dist/style.css"; //Important for Styling

function Popkit() {
  const [modal, setModal] = useState(false);

  const handlePopup = () => {
    setModal(!modal);
  };

  const onSubmit = (event) => {
    event.preventDefault(); // Prevents the default form submission behavior

    // Access the input value
    const enteredEmail = event.target.elements.newsletter.value;
    console.log("Entered email:", enteredEmail);

    // You can perform further actions here, such as sending the email to a server
    //Or setting the value to the state
    // anything you like
  };
  return (
    <>
      <button onClick={handlePopup}>Trigger Popkit!</button>

      <NewsletterPopup
        title={"Subscribe to our newsletter "}
        description={
          "Receive new articles and resources directly on your inbox. fill you email below to join our email newsletter today  "
        }
        buttonColor={"4A3AFF"} //add hexcode without hashtag (#)
        open={modal}
        setOpen={handlePopup}
        onSubmit={onSubmit} // get value from input on form submit
        isDark={false} // {true} -> means dark theme, {false} -> means light theme
        iconImage={"https://i.ibb.co/LCQvnrL/Group-37333.png"}
      />
    </>
  );
}

export default Popkit;

Cookies Popup 👇

Popup

import React, { useState } from "react";
import { CookiesPopup } from "popkit";
import "popkit/dist/style.css"; //Important for Styling

function Popkit() {
  const [modal, setModal] = useState(false);

  const handlePopup = () => {
    setModal(!modal);
  };

  return (
    <>
      <button onClick={handlePopup}>Trigger Popkit!</button>

      <CookiesPopup
        title={"Cookie Policy"}
        description={
          "We care about your data, and we’d use cookies only to improve your experience.By using this website, you accpet out Cookies Policy."
        }
        iconImage={"https://i.ibb.co/6DQ7MPY/Component-1.png"}
        open={modal}
        setOpen={handlePopup}
        onSubmit={handlePopup}
        isDark={false} // {true} -> means dark theme, {false} -> means light theme
        crossButton={true} // wether you need a cross button on top left corner or not
      />
    </>
  );
}

export default Popkit;

Is That All?

Absolutely not! We're constantly adding more exciting components, including cool popups with various styles, as well as toasts, alert messages, and much more!

Contribute

Show your ❤️ and support by giving a ⭐. Any suggestions are welcome!

Have ideas or want to contribute? Show support by Clicking Here