1.0.8 • Published 6 months ago

@alex-pqn/react-modal v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

@alex-pqn/react-modal

NPM npm GitHub package.json version

Prerequisites

  • You will need to have Node and npm installed locally on your machine.
Node VersionSupported
16.x & >:x:
15.x:white_check_mark:

Install

npm i @alex-pqn/react-modal

Example

Modale

Usage

import React, { useState } from 'react';

import { Modal } from '@alex-pqn/react-modal';

const App = () => {
  const [isModalShown, setIsModalShown] = useState(false);

  const openModal = () => setIsModalShown(true);

  return (
    <main>
      <button onClick={openModal}>Open modal</button>

      <Modal
        isShown={isModalShown}
        trigger={setIsModalShown}
        width={27}
        title="Your modal title"
        message="Your modal message"
      />
    </main>
  );
};

export default App;

Props

NameDescriptionTypeIs RequiredDefault
isShownIs modal shown ?booleanYesn/a
triggerA trigger for turning off the modalfuncYesn/a
widthThe modal widthnumber 1-100No27
titleYour modal titlestringNoYour modal title
messageYour modal message (can be DOM)n/aNoYour modal message
1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago