logo

VideoModal

Used to trigger a Vídeo Modal and plays your video inside a modal.

Props:

videoUrl

Description: The video embedded address. The videoUrl should be in the format https://www.youtube.com/embed/video_id, example: https://www.youtube.com/embed/TXFOSt9uli4. Type: String. Required.

isOpen

Description: Define if VideoModal should be open or closed. Type: Boolean. Required.

onRequestClose

Description: Function invoked on modal requests close. Type: Function. Required.

modalClassName

Description: Modal container ClassName. Type: String.

overlayClassName

Description: Modal overlay ClassName. Type: String.

Codeconst [modal, setModal] = useState(true)
function closeModal() { setModal(false) }
function openModal() { setModal(true) }
<VideoModal addressUrl='https://www.youtube.com/watch?v=w7ejDZ8SWv8&t=10s' isOpen={modal} onRequestClose={closeModal} overlayClassName='react-modal-overlay' modalClassName='active-modal' showAnimation />

PabloSilvaDev - © Copyright 2022