An Interest In:
Web News this Week
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
September 21, 2021 12:08 am GMT
Original Link: https://dev.to/abodmicheal/react-dialog-box-library-b1b
React dialog box library
react-js-dialog-box
simple react.js modal box
Intro
Install
npm install --save react-js-dialog-box
Usage
import React from 'react'import { ReactDialogBox } from 'react-js-dialog-box'import 'react-js-dialog-box/dist/index.css'class App extends React.Component { constructor() { super() this.state = { isOpen: false } } openBox = () => { this.setState({ isOpen: true }) } closeBox = () => { this.setState({ isOpen: false }) } render() { return ( <div> <button onClick={this.openBox}>Open ReactDialogBox </button> {this.state.isOpen && ( <> <ReactDialogBox closeBox={this.closeBox} modalWidth='60%' headerBackgroundColor='red' headerTextColor='white' headerHeight='65' closeButtonColor='white' bodyBackgroundColor='white' bodyTextColor='black' bodyHeight='200px' headerText='Hearder ' > <div> <h1>Dialog Content</h1> </div> </ReactDialogBox> </> )} </div> ) }}export default App
License
MIT abodmicheal
Original Link: https://dev.to/abodmicheal/react-dialog-box-library-b1b
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To