react-common-modal
Simple Modal Dialog
Installation
With npm
npm i react-common-modal --save --save-exact
With yarn
yarn add react-common-modal -E
Usage
./Dialog.js
import React from "react";import from "react-common-modal"; Dialog.propTypes = ; export default
./App.js
import React from "react";import Dialog from "./Dialog"; export default class App extends React.Component
Props
Dialog
Name | Type | Default | Description |
---|---|---|---|
open | Boolean | false | If true the Modal Dialog is open |
position | String: top-left | top-center | top-right center-left | center | center-right bottom-left | bottom-center | bottom-right |
center | Position Modal Dialog on the page |
children | Node | Modal Dialog children, usually the included sub-components | |
className | String | The className to add to the content container | |
backdropClassName | String | The className to add to the overlay container |
DialogTitle
Name | Type | Default | Description |
---|---|---|---|
title | String | Node | The title to display on the Modal Dialog | |
onClose | Func | Fired when to be click on the close button | |
className | String | The className to add to the content container | |
titleClassName | String | The className to add to the title container |
DialogContent
Name | Type | Default | Description |
---|---|---|---|
children | Node | Content children, usually the included sub-components | |
className | String | The className to add to the content container |
DialogActions
Name | Type | Default | Description |
---|---|---|---|
align | String: start | center | end |
end | Align actions content |
children | Node | Actions children, usually the included sub-components | |
className | String | The className to add to the content container |
Live Example
https://react-common-modal.firebaseapp.com/
Licence
MIT