Fullscreen Popup Video

How to Create a React Fullscreen Popup Video?

Create a nice fullscreen popup video lightbox easily and make your website beautiful!

Installation

Run the command

npm install fslightbox-react

Create a Component

import React, { useState } from 'react';
import FsLightbox from 'fslightbox-react';
 
const LightboxComponent = () => {
    const [toggler, setToggler] = useState(false);
    return (
        <>
            <button onClick={ () => setToggler(!toggler) }>
                Toggle Lightbox
            </button>
            <FsLightbox
                toggler={ 
                    toggler 
                }
                sources={ [
                    'https://www.youtube.com/watch?v=bk7McNUjWgw'
                ] }
            />
        </>
    );
};

export default LightboxComponent;

Learn more: Fslightbox React

Leave a Reply

Your email address will not be published.