0.0.5 • Published 6 years ago

use-fullscreen v0.0.5

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
6 years ago

React hook for the fullscreen API

A React hook that gives you the current fullscreen state, and a toggle function if fullscreen is available and enabled in the browser.

Works in modern browsers and IE11.

import useFullscreen from 'use-fullscreen';

function Example() {
  const [isFullscreen, toggleFullscreen] = useFullscreen();
  return (
    <div>
      <h1>Is {!isFullscreen && <i>not</i>} fullscreen</h1>
      {toggleFullscreen ? (
        <button onClick={() => toggleFullscreen()}>Toggle fullscreen</button>
      ) : (
        <b>Fullscreen not supported :(</b>
      )}
    </div>
  );
}

Fullscreen example

0.0.5

6 years ago

0.0.4

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago