1.14.0 • Published 1 year ago

juliengilbertdev-modal v1.14.0

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

React Modal Component

This component provides a customizable modal interface that can be easily integrated into your React applications. You can control its visibility and appearance using props.

Installation

You can install this component via npm:

npm install juliengilbertdev-modal

Import the Counter component

import { Modal } from "juliengilbertdev-modal";

Requierements

Node

  • Node version : v22.2.0

Props

  • isOpen (boolean): Controls whether the modal is open or closed.
  • setIsOpen (function): Function to toggle the isOpen state.
  • mainTitle (string): Title text displayed in the modal header.
  • text (string): Text content displayed in the modal body.
  • icon (string, optional): Optional icon displayed alongside the mainTitle.
  • mainStyle (object, optional): CSS styles for the main title.
  • textStyle (object, optional): CSS styles for the text content.

These props allow you to customize the appearance and behavior of the Modal component within your React application.

Usage

Here's how you can use the Modal component in your React application:

import React from "react";
import { Modal } from "juliengilbertdev-modal";

const App = () => {
  const [isOpen, setIsOpen] = React.useState(false);

  return (
    <div>
      <button onClick={() => setIsOpen(true)}>Open Modal</button>
      <Modal
        isOpen={isOpen}
        setIsOpen={setIsOpen}
        mainTitle="My Modal Title"
        text="This is the content of the modal."
        icon="🎉"
        mainStyle={{ color: "blue", fontSize: "24px" }}
        textStyle={{ fontWeight: "bold" }}
      />
    </div>
  );
};

export default App;

Have fun 🙂

1.14.0

1 year ago

1.13.0

1 year ago

1.12.0

1 year ago

1.11.0

1 year ago

1.10.0

1 year ago

1.9.0

1 year ago

1.8.0

1 year ago

1.7.0

1 year ago

1.6.0

1 year ago

1.5.0

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago