0.2.16 • Published 7 years ago
@alexseitsinger/simple-modal v0.2.16
SimpleModal
A modal that can be used with react redux.
Parameters
propsobjectprops.children(Node | Array) The child elements to render.props.backgroundShadeString The background shade to use. (optional, defaultdark)props.closeButtonVisibleBoolean Determine if the close button is visible. (optional, defaulttrue)props.closeButtonStyleObject Extra style to apply to the close button. (optional, default{})props.closeButtonPositionString The position of the close button. (optional, defaultforeground)props.closeButtonBody(Node | Array) The body of the close button. (optional, defaultclose)props.onCloseFunction The function to invoke when the modal closes.props.onOpenFunction The function to invoke when the modal opens. (optional, default()=>{})props.isVisibleBoolean Determines if the modal is rendered into the DOM.props.onEscapeKeyFunction The function to invoke when then esacpe key is pressed. (optional, default()=>{})props.onClickBackgroundFunction The function to invoke when the background of the modal is clicked. (optional, default()=>{})props.containerClassNameString The classname to use for the modal container element. (optional, defaultSimpleModal)props.layerPositionString The layer position to use for the zIndex. (optional, defaultabove)props.defaultIndexNumber The default zIndex to start from. (optional, default100)props.mainElementSelectorString The selector to use to find the main element in the DOM. (optional, defaultmain)props.mountPointSelectorString The selector to use to find the mount point element in the DOM> (optional, defaultbody)
Examples
<SimpleModal
isVisible={true}
closeButtonPosition={"window"}
onClose={() => {
doClose()
}}
onEscapeKey={() => {
doClose()
}}>
<div>An example modal body</div>
</SimpleModal>