Skip to content

A React component that sets its children to fullscreen using the Fullscreen API.

License

Notifications You must be signed in to change notification settings

liran/fullscreen-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fullscreen-react

A React component that sets its children to fullscreen using the Fullscreen API.

Usage

Install.

yarn add fullscreen-react

Import component.

import Fullscreen from 'fullscreen-react';

Setup and render.

import React, { useState } from "react";
import Fullscreen from "fullscreen-react";

function App() {
  const [isEnter, setIsEnter] = useState(false);

  return (
    <div>
      <button
        onClick={() => {
          setIsEnter(true);
        }}
      >
        Go Fullscreen
      </button>

      <Fullscreen isEnter={isEnter} onChange={setIsEnter}>
        <div>
          Hi! This may cover the entire monitor.
        </div>
      </Fullscreen>
    </div>
  );
}

export default App;

About

A React component that sets its children to fullscreen using the Fullscreen API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •