Skip to main content

Component <SlideModal />

Props

PropsTypeMeaningPossible values
horizontalPositionstringChange modal horizontal position on the screenleft / right
maxWidthstring / numberChange modal max widthfrom 0 to any number or string with units
fullWidthbooleanSet modal width to full width but limited by maxWidth proptrue / false
isOpenbooleanSet modal statustrue / false
handleClosefunctionActions, after modal x-mark was clicked() => void



Positions

const SlideModalPosition = ({ horizontalPosition }) => {
const [isModal, setModal] = useState(false)

return (
<>
<button onClick={() => setModal(true)}>Modal {horizontalPosition}</button>

<SlideModal
horizontalPosition={horizontalPosition}
isOpen={isModal}
handleClose={() => setModal(false)}
>
Hello my dear friend!
</SlideModal>
</>
)
}



Sizes

const SlideModalSize = ({ maxWidth }) => {
const [isModal, setModal] = useState(false)

return (
<>
<button onClick={() => setModal(true)}>{maxWidth} width modal</button>

<SlideModal
maxWidth={maxWidth}
isOpen={isModal}
handleClose={() => setModal(false)}
fullWidth
>
Hello my dear friend!
</SlideModal>
</>
)
}