0.1.3 • Published 3 years ago

simple-react-modal-components v0.1.3

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

react-modal-package

Package that contains multiple modals to be used within a react environment

SimpleModal

Ex.

<SimpleModal 
    backgroundDim={ true }
    title="This is the modal body"
    close = { () => {
        setSimpleModalOpen( false )
    }}
    done = { () => {
        setSimpleModalOpen( false )
    }}
    open={ SimpleModalOpen }
    size={ "medium" }
/>

Props

proptypeDescription
backgroundDimbooldims the background when modal is open
titlestring/ react componenttitle set at the top of the modal
bodystring/react componentbody set within the body of the modal
donecallbackWhen set, a done button will appear that will have an assigned callback
closecallbackfunction to close modal
openbooldetermines if the modal is open
sizestringcan be set to small, medium, large, default: large

JsonModal

Ex.

<JsonModal 
    contents={contents}
    backgroundDim={true}
    close={() => {
        toggleJsonModal(false)
    }}  
    done={()=>{
        toggleJsonModal(false)
    }}
    open={jsonModalOpen}
    size={jsonModalSize}
/>

Contents Ex.

const contents = ({
  title: "json modal title",
  body:"this is the modal body"
})

Props

proptypeDescription
backgroundDimbooldims the background when modal is open
contentsjson objectbody set within the body of the modal
donecallbackWhen set, a done button will appear that will have an assigned callback
closecallbackfunction to close modal
openbooldetermines if the modal is open
sizestringcan be set to small, medium, large, default: large

Features

  • Mobile and desktop friendly
  • Lightweight with no dependancies
  • Simple to re-stylize
  • Easy to inset components within the modal (SimpleModal)
  • Easy to deploy
0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago