Skip to content

Matthieu-Mary/simple_react_modale_mm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>
  );
};

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published