@berlitz/modal

4.0.5 • Public • Published

Modal npm version

Installation

yarn add @berlitz/modal

Props

Argument Type Required Default Description
children node - Used to fill the inside of the modal with content.
onClose function - Callback function called when the close button is click, the user clicks outside the modal or presses the 'escape' key.
open boolean false Opens or closes the modal.
size string sm Sets the size of the modal.

Usage

// TODO fill this in
import Modal from '@berlitz/modal'

export class App extends React.Component {
  state = {
    open: this.props.open || false,
  }

  render() {
    return (
      <>
        <Modal
          size="md"
          open={this.state.open}
          onClose={() => this.setState({ open: false })}
        >
          <h1>All of my modal content goes here</h1>
        </Modal>
        <Button onClick={() => this.setState({ open: true })}>
          Open Modal
        </Button>
      </>
    )
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @berlitz/modal

Weekly Downloads

1,006

Version

4.0.5

License

MIT

Unpacked Size

24 kB

Total Files

6

Last publish

Collaborators

  • berlitz