0.2.0 • Published 8 years ago
@fate-lovely/react-dialog v0.2.0
React Dialog
a simple dialog component for React
Installation
npm
npm i --save @fate-lovely/react-dialogcdn
<script src="https://unpkg.com/@fate-lovely/react-dialog/dist/index.js"></script>Usage
import { showDialog, Dialog } from "@fate-lovely/react-dialog"
const MyDialog = () =>
<Dialog>
<h1>Hello World</h1>
</Dialog>
class App extends React.Component {
...
onClick() {
showDialog(MyDialog, props)
}
}Props
className: PorpTypes.stringokButtonText: PropTypes.stringcancelButtonText: PropTypes.stringokButtonCB: PropTypes.func, dialog instance as first paramcmp, you can callcmp.destroy()to destroy dialogcancelButtonCB: PropTypes.func, dialog instance as first paramcmp, you can callcmp.destroy()to destroy dialoghideCancelButton: PropTypes.booltitle: PorpTypes.stringokButtonDisabled PropTypes.bool
License
Released under the MIT license