1.0.2 • Published 1 year ago

react-popup-cards v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Popup Component

alt text

Overview

The Popup component is a customizable modal dialog for React applications. It allows you to display messages, titles, and emojis with an action button. The popup can be configured to close automatically when clicking outside of it.

Features

  • Customizable title, message, and emoji
  • Customizable button text, color, and background color
  • Configurable width, height, and background color of the popup
  • Option to auto-close the popup on outside click
  • Callback function after button click

Installation

You can install the Popup component from npm:

npm i react-popup-cards

Usage

  1. Import the Popup component:

    import { PopupCard }  from 'react-popup-cards';
  2. Use the Popup component in your application:

    const App = () => {
      return (
        <div>
          <PopupCard
            message="Your custom message"
            title="Your custom title"
            emoji="✅"
            buttonText="Close"
            width="400px"
            height="250px"
            bgColor="#f0f0f0"
            buttonColor="#fff"
            buttonBgColor="#007bff"
            autoCloseOnOutsideClick={true}
            afterNavigation={() => console.log('Button clicked!')}
          />
        </div>
      );
    };
    
    export default App;

Props

PropTypeDefaultDescription
messagestring"Default message"The message displayed in the popup.
titlestring"Default title"The title displayed at the top of the popup.
emojistring"✅"The emoji displayed to the left of the message.
afterNavigationfunctionundefinedCallback function invoked after the button is clicked.
buttonTextstring"OK"The text displayed on the button.
widthstring"300px"The width of the popup.
heightstring"200px"The height of the popup.
bgColorstring"#ffffff"The background color of the popup.
buttonColorstring"#fff"The text color of the button.
buttonBgColorstring"#0000ff"The background color of the button.
autoCloseOnOutsideClickbooleantrueIf true, the popup will close when clicking outside of it.

Development

To contribute to the development of this component:

  1. Clone the repository:

    git clone https://github.com/madhurajayashanka/react-popup-card-npm.git
  2. Navigate to the project directory:

    cd react-popup-card-npm
  3. Install the dependencies:

    npm install
  4. Run the development server:

    npm start

License

This project is licensed under the MIT License. See the LICENSE file for more details.

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago