1.4.4 • Published 1 year ago

modal-react-komponent v1.4.4

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

React Modal Komponent

React Modal Komponent is a simple and customizable modal component for React applications.

https://www.npmjs.com/package/modal-react-komponent

made-with-npm

react

typescript

Installation

You can install React Modal Komponent via npm:

  npm i modal-react-komponent

Usage

To use React Modal Komponent in your application, simply import it and render it within your component hierarchy.

Simple example

import { Modal } from "modal-react-komponent";
import { useState } from "react";

export default function MyApp() {
  const [isOpen, setIsOpen] = useState(false);

  const toggleModal = () => {
    setIsOpen(!isOpen);
  };

  return (
    <div>
      <button onClick={toggleModal}>Open modal</button>
      <Modal
        title="Hi folks!"
        message="Hello from modal-react-komponent"
        buttonText="Close modal"
        isOpen={isOpen}
        toggleOpen={toggleModal}
      />
    </div>
  );
}

Custom

You can custom the modal using 5 parameters

ParameterTypeDescription
titlestringThe title of the modal
messagestringThe message displayed in the modal
buttonTextstringThe text of the close button
isOpenbooleanControls the open state of the modal
toggleOpenfunctionFunction to change the open state

Screenshot

This is a simple preview of the modal

giphy

Authors

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago