1.1.2 • Published 2 years ago

r-modal-sf v1.1.2

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

r-modal-sf

npm github

Installation

npm i r-modal-sf

import { Modal } from 'r-modal-sf';

Example

Here is a simple example of r-modal-sf being used in an app

import React, { useState } from "react";
import { Modal } from "r-modal-sf";

export const App = () => {
  const [modalOpen, setModalOpen] = useState(false);

  const toggleModal = () => {
    setModalOpen(!modalOpen);
  };
  return (
    <>
      <button onClick={toggleModal}>Open modal</button>

      <Modal
        content="test content"
        modalOpen={modalOpen}
        modalClose={toggleModal}
        buttonContent="X"
      />
    </>
  );
};

You can also use custom style

const customStyle = {
  overlay: {
    backgroundColor: "green",
  },
  content: {
    backgroundColor: "white",
    borderRadius: "10px",
  },
  close: {
    padding: "5px 17px",
    size: "14px",
    border: "none",
  },
};

<Modal
  content="test content"
  modalOpen={modalOpen}
  style={customStyle}
  modalClose={toggleModal}
  buttonContent="X"
/>;
1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

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