Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.2 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.2 KB

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