Skip to content

baskvava/react-video-modal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React-Video-Modal NPM Version PRs Welcome

This is a react library for a video inside of a modal

Documents and Demo

Installation

npm install @baskvava/react-video-modal

or

yarn add @baskvava/react-video-modal

Example

import React, { useState } from "react";
import { ModalVideo, useToggle } from "@baskvava/react-video-modal";

function App() {
  const { isOpen, toggle, close } = useToggle();

  return (
    <div className="App">
      <button onClick={toggle}>Open Video Modal</button>
      <ModalVideo
        title="video"
        header="Fixed width Video"
        width={800}
        isOpen={isOpen}
        onClosed={close}
        url="https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
      />
    </div>
  );
}
export default App;

Local ENV

install the node package

yarn install

run example

yarn dev