5.1.2 • Published 4 years ago

@alexseitsinger/react-simple-modal v5.1.2

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
4 years ago

SimpleModal

A simple modal

Installation

yarn add @alexseitsinger/react-simple-modal

Props

NameDescriptionDefaultRequired
modalNameThe unique name of the modal.undefinedtrue
containerClassNameCustom classname to use for the modal."SimpleModal"false
containerLayerThe default z-index to use for the modal200false
backgroundShadeThe background color to use for the modal's background."dark"false
onClickBackgroundInvoked when the background is clicked.undefinedfalse
closeButtonClassNameThe class name to use for the close button."SimpleModal-CloseButton"false
isCloseButtonVisibleShow the close buttonfalsefalse
closeButtonStyleAdditional css to apply to the close buttonundefinedfalse
renderCloseButtonInvoked to render the button bodyundefinedfalse
onEscapeKeyInvoked whenever the escape key is pressed.undefinedfalse
childrenThe content to render in the modalundefinedfalse

Example

// Within App root
import { SimpleModalProvider } from "@alexseitsinger/react-simple-modal"

function App({ store, history }) {
  return (
    <Provider store={store}>
      <ConnectedRouter history={history}>
        <SimpleModalProvider>
          <Route patch={"/"} exact component={HomePage} />
        </SimpleModalProvider>
      </ConnectedRouter>
    </Provider>
  )
}
// Within app page
import { SimpleModal } from "@alexseitsinger/react-simple-modal"

function HomePage() {
  return (
    <SimpleModal
      modalName={"home-page-modal"}>
      <div>Some modal content.</div>
    </SimpleModal>
  )
}
5.1.2

4 years ago

5.1.0

4 years ago

5.0.0

4 years ago

4.0.0

4 years ago

3.1.0

4 years ago

3.0.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.3.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.0

5 years ago

0.5.0

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago