1.0.2 • Published 4 years ago

react-modern-dialog v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

react-modern-dialog

A simple and modern dialog implementation for react.

Installation

# NPM
$ npm install --save react-modern-dialog
VersionCompatibility
1.xReact 16.8+

Basic usage

See DEMOS at react-modern-dialog

import ReactDOM from 'react-dom';
import React, { useState } from 'react';
import { Dialog } from 'react-modern-dialog';

const App = () => {
  const [ isVisible, setIsVisible ] = useState(true);
  render() {
    return (
      <div>
        {
          isVisible &&
          <Dialog
            onCloseClick={() => setIsVisible(false)}>
            <span>
              This is the dialog body.
            </span>
          </Dialog>
        }
      </div>
    );
  }
}

ReactDOM.render(<App/>, document.body);

Properties

NameTypeRequiredDescriptionDefault
titleStringThe title of the DialogEmpty
classNameStringDialog classEmpty
cancelableBooleanWhether the dialogs closes by clicking outside or notfalse
positiveTextStringPositive button textEmpty
negativeTextStringNegative button textEmpty
onPositiveClickfunctionPositive button click functionEmpty
onNegativeClickfunctionPositive button click functionEmpty
onCloseClickfunction:white_check_mark:Close button click functionEmpty

License

MIT © DenkSchuldt

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago