Modal component for React [NPM Package]

  • node module
  • nodejs
  • react
  • react component

Table Of Contents

    Modal component for React using some CSS styles from Bootstrap as well as custom CSS styles.

    Install and save component as a dependency

    npm install --save library-modal-component

    Install Bootstrap as a dependency

    npm install --save bootstrap

    Import component into your app

    import ModalComponent from 'library-modal-component'

    Import Bootstrap Javascript into your app

    import 'bootstrap/dist/js/bootstrap.bundle.js'

    Create the function that will handle the modal confirm

    handleModalConfirm (event, modalId) {

    Render the component with the functions we created as well as any other props that are needed

    render () {
        return (
                modalTitle="Modal title"
                modalBody="Modal body"
                handleModalConfirm={this.handleModalConfirm.bind(this)} />
    Prop Values
    modalTheme light or dark
    modalId String
    modalTitle String
    modalBody String
    modalCloseText String
    modalClose String
    modalConfirmText String
    modalConfirm handleModalConfirm function

    Bronson Dunbar

    I'm a WordPress fanatic, a fan of React & AWS and a Sass magician! I also enjoy capturing moments through the lens of my Canon

    Leave a Reply

    Your email address will not be published. Required fields are marked *