Introducing reactjs-popup 🎉 (3kb)—React popup, Modals, Tooltips and Menus — All in one

Youssouf El Azizi

February 02, 2018


This article is about giving you a simple overview of what you can do with reactjs-popup and how to use it effectively.

Today, we are excited to announce reactjs-popup 1.0.

Reactjs-popup is a simple and very small (3 kb) react popup component, with multiple use cases. we created reactjs-popup to create a color picker for our project picsrush a new online image editor. After a while, We decided to make it available for everyone in GitHub and npm repository.

Why do you need to choose reactjs**-**popup over all other implementation?

  • Built with react fragment that’s mean no additional wrapper Divs in your code or in the trigger element. 😮
  • Does not inject HTML outside your app root. 📦
  • Function as children pattern to take control over your popup anywhere in your code. 💪
  • Modal, Tooltip, Menu, Toast(coming soon) : All in one component🏋️
  • Full style customization. 👌
  • Easy to use. 🚀
  • All these clocks in at around 3 kB zipped. ⚡️
  • Animation (coming soon).

How can reactjs-popup help you in your next react project?

If you need to create a simple modal, tooltip or a nested menu this component is your best choice to start with. but first let get started with the component.

Getting Started

This package is available in npm repository as reactjs-popup. It will work correctly with all popular bundlers.

1npm install reactjs-popup --save
2#using yarn
3yarn add reactjs-popup -S

Now you can import the component and start using it :

1import React from "react";
2import Popup from "reactjs-popup";
3
4default () => (
5 <Popup trigger={<button> Trigger</button>} position="right center">
6 <div>Popup content here !!</div>
7 </Popup>
8);

You can also use it with function as children pattern.

1import React from "react";
2import Popup from "reactjs-popup";
3
4default () => (
5 <Popup trigger={<button>Trigger</button>} position="top left">
6 {close => (
7 <div>
8 Content here{" "}
9 <a className="close" onClick={close}>
10 &times;
11 </a>
12 </div>
13 )}
14 </Popup>
15);

Complete component API : Reactjs-popup Component API

Use Cases 🙌

ALL in one demo

What’s Next For reactjs-popup ?

The next version of reactjs-popup will support creating Simple Toast with full customization, But our big deal is to add Animation API to the component so feel free if you have any ideas 💪.

Thanks for reading! If you think other people should read this post and use this component, clap for me, tweet and share the post.

Remember to follow me on Medium so you can get notified about my future posts.


It your turn now to try it !!!


Show your support!

That’s all, thank you for your attention, please star the repo to show your support…

Share article