1.0.7 • Published 4 years ago

react-icon-popup v1.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

react-icon-popup

A Tiny React Icon Popup. Its compatable with typescript.

Demo

Demo

How to Use

First install the package with npm

$ npm i react-icon-popup --save

Import IconPoup from the package.

import IconPopup from "react-icon-popup";
import App from "./App.js";

function main() {
  return (
    <>
      <IconPopup
        popupTriggerer={<span>Icon to be clicked</span>}
        popupContent={
          <div
            onClick={() => {
              alert("popup clicked");
            }}
          >
            Content Inside the Popup
          </div>
        }
        onPopupTrigger={(...args) => {
          console.log(args);
        }}
        popupWidthInPx={100}
      />
    </>
  );
}

API

IconPopup

KeyValue TypeIs OptionalInfo
popupContentReact ElementNowill be rendered inside the popup
popupTriggererReact ElementNowill be rendered as popup opener/closer
popupWidthInPxnumberNoshould specify the required width of the popup content
containerStyleobjectYessame as react style object *
arrowStyleobjectYessame as react style object *
popupStyleobjectYessame as react style object *
onPopupTrigger(isOpened,event)Yeswill called when popup opens or closes
popupMaxHeightInPxnumberYescan specify mini height for the popup content

* - some position css attributes will be removed

Raising Issues and PRs are heartly welcomed.

with :heart: by Akash Basavaraju
1.0.7

4 years ago

1.0.6

4 years ago

1.0.2

4 years ago

1.0.5-0

4 years ago

1.0.4-0

4 years ago

1.0.5

4 years ago

1.0.3-0

4 years ago

1.0.1

4 years ago

1.1.0-0

4 years ago