1.0.6 • Published 2 years ago

@glg-dev/react-modal v1.0.6

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

react-modal plugin

A library of React components created using create-react-app.

Installation

Run the following command:npm install @glg-dev/react-modal

How to use

import React, { useState } from 'react';
import { Modal } from "@glg-dev/react-modal";

const App = () => {

  const [display, setDisplay] = useState(false)
  const yourTitle = "Write your title"
  cont message = "Your message here

  return (
    <div>
      <button onClick={() => setDisplay(true)}>
        Show modal
      </button>
      <Modal 
        title={yourTitle} 
        content={message} 
        hideModal={() => setDisplay(false)}
        visible={display}
      />

    </div>
  );
};

export default App;

How to custom

If you want add your own style, copy and edit the following snippet:

:root {
  --modal-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --modal-text-color: #000;
  --modal-text-decoration: none;
  --modal-z-index: 100;
  --modal-wrapper-bg: rgba(0, 0, 0, 0.7);
  --modal-container-bg: #FFF;
  --modal-container-border-radius: 1rem;
  --modal-container-shadow: rgba(0, 0, 0, 0.1) 0px 0px 15px, rgba(0, 0, 0, 0.3) 0px 0px 15px;
  --modal-container-padding: 2rem;
  --modal-elements-gap: 1rem;
  --modal-close-button-color: black;
  --modal-close-button-border-radius: 50%;
  --modal-title-font-size: 1.5rem;
  --modal-content-font-size: 1rem;}
1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago