5.1.2 • Published 4 years ago
@alexseitsinger/react-simple-modal v5.1.2
SimpleModal
A simple modal
Installation
yarn add @alexseitsinger/react-simple-modal
Props
Name | Description | Default | Required |
---|---|---|---|
modalName | The unique name of the modal. | undefined | true |
containerClassName | Custom classname to use for the modal. | "SimpleModal" | false |
containerLayer | The default z-index to use for the modal | 200 | false |
backgroundShade | The background color to use for the modal's background. | "dark" | false |
onClickBackground | Invoked when the background is clicked. | undefined | false |
closeButtonClassName | The class name to use for the close button. | "SimpleModal-CloseButton" | false |
isCloseButtonVisible | Show the close button | false | false |
closeButtonStyle | Additional css to apply to the close button | undefined | false |
renderCloseButton | Invoked to render the button body | undefined | false |
onEscapeKey | Invoked whenever the escape key is pressed. | undefined | false |
children | The content to render in the modal | undefined | false |
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