Skip to content

CodeStarGM/popkit

Repository files navigation

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

About

the essential React library for crafting captivating popups, modals, toasts, and alerts. πŸš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published