Giter VIP home page Giter VIP logo

react-fullscreen's Introduction

React FullScreen

npm versionLicense: MITBuild StatusDependenciesNetlify StatusLanguage grade: JavaScript

Component that performs fullscreen in DOM Elements

Installation

npm i react-easyfullscreen
// OR
yarn add react-easyfullscreen

Local demo:

git clone https://github.com/andrelmlins/react-fullscreen.git
cd react-fullscreen
yarn install && yarn start

Examples

import React from 'react';
import { render } from 'react-dom';
import ReactFullscreeen from 'react-easyfullscreen';

const App = () => (
  <ReactFullscreen>
    {({ ref, onRequest, onExit }) => (
      <div
        ref={ref}
        style={{ backgroundColor: 'red', width: 120, height: 120 }}
      >
        <button onClick={() => onRequest()}>FullScreen</button>
        <button onClick={() => onExit()}>Screen</button>
      </div>
    )}
  </ReactFullscreen>
);

render(<App />, document.getElementById('root'));

Properties

Raw component props (before transform):

Prop Type Description
onChange func Call in change
onError func Call in error

Children Function Properties

Prop Type Description
ref object Ref dom element
isEnabled bool If it's possible fullscreen
onToggle func Call for fullscreen toggle
onExit func Call for fullscreen exit
onRequest func Call for fullscreen enter

NPM Statistics

Download stats for this NPM package

NPM

License

React FullScreen is open source software licensed as MIT.

react-fullscreen's People

Contributors

andrelmlins avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.