1.0.2 • Published 1 year ago

typescript-simple-react-modale-mm v1.0.2

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

npm.io npm.io npm.io

Prerequisites

Getting Started

Install this package:

npm add typescript-simple-react-modale-mm

Import the Modale component:

import { Modale } from "typescript-simple-react-modale-mm";

You can then render the Modale component like any other React component in JSX.

Example

import { Modale } from "typescript-simple-react-modale-mm";
import { useState } from "react";

const App = () => {
  const [showModale, setShowModale] = useState(false);

    const handleCLose = () => {
        setShowModale(false);
    }

  return (
    <div>
      <button onClick={() => setShowModale(true)}>Open Modal</button>
      {showModale ?? (
        <Modale
          onClose={handleClose}
          imageSrc={closeBtn}
          imageName="close button"
          text="Say something usefull"
          linkText="Go to somewhere"
          linkPath="/"
        />
      )}
    </div>
  );
};
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago