{"id":15416685,"url":"https://github.com/bunlong/react-fullscreen-html","last_synced_at":"2025-09-10T17:32:13.423Z","repository":{"id":72263609,"uuid":"288128883","full_name":"Bunlong/react-fullscreen-html","owner":"Bunlong","description":"The React component allows its children to enter the browser's fullscreen viewing mode using the Fullscreen HTML5.","archived":false,"fork":false,"pushed_at":"2020-08-29T07:54:25.000Z","size":49,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-20T20:36:03.190Z","etag":null,"topics":["full-screen","fullscreen","fullscreen-mode","react","react-fullscreen-html","reactjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bunlong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-17T08:45:53.000Z","updated_at":"2023-03-23T06:39:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"fcdfaa94-ed8d-4599-8d80-6c7b50c5c195","html_url":"https://github.com/Bunlong/react-fullscreen-html","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"071e1338bcc292b37335f9408620b2a4f4aa4118"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-fullscreen-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-fullscreen-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-fullscreen-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-fullscreen-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bunlong","download_url":"https://codeload.github.com/Bunlong/react-fullscreen-html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232548628,"owners_count":18540149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["full-screen","fullscreen","fullscreen-mode","react","react-fullscreen-html","reactjs"],"created_at":"2024-10-01T17:13:24.930Z","updated_at":"2025-01-05T05:02:00.483Z","avatar_url":"https://github.com/Bunlong.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-fullscreen-html\n\nThe React component allows its children to enter the browser's fullscreen viewing mode using the Fullscreen HTML5.\n\n[![NPM](https://img.shields.io/npm/v/react-fullscreen-html.svg)](https://www.npmjs.com/package/react-fullscreen-html) [![downloads](https://img.shields.io/npm/dm/react-fullscreen-html.svg?style=flat-square)](https://www.npmjs.com/package/react-fullscreen-html) ![npm bundle size](https://img.shields.io/bundlephobia/min/react-fullscreen-html) [![Build Status](https://api.travis-ci.com/Bunlong/react-fullscreen-html.svg?branch=master)](https://travis-ci.com/Bunlong/react-fullscreen-html) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## 🎁 Features\n\n* Compatible with both JavaScript and TypeScript\n* Compatible with both Desktop and Mobile browsers\n* Compatible with all browsers\n* No dependency\n* Easy to use\n\n## 🔧 Install\n\nreact-fullscreen-html is available on npm. It can be installed with the following command:\n\n```\nnpm install react-fullscreen-html --save\n```\n\nreact-fullscreen-html is available on yarn as well. It can be installed with the following command:\n\n```\nyarn add react-fullscreen-html\n```\n\n## 💡 Usage\n\n### 🎀 Basic\n\n```jsx\nimport React from 'react';\nimport { Fullscreen, useFullscreen } from \"react-fullscreen-html\";\n\nfunction App() {\n  const screen = useFullscreen();\n\n  return (\n    \u003cdiv\u003e\n      \u003cbutton onClick={screen.enter}\u003e\n        Enter fullscreen\n      \u003c/button\u003e\n\n      \u003cFullscreen handle={screen}\u003e\n        Any fullscreen content here\n      \u003c/Fullscreen\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n```\n\n### 🎀 Advanced\n\n```jsx\nimport React, {useCallback} from 'react';\nimport { Fullscreen, useFullscreen } from \"react-fullscreen-html\";\n\nfunction App() {\n  const screen1 = useFullscreen();\n  const screen2 = useFullscreen();\n\n  const reportChange = useCallback((state, handle) =\u003e {\n    if (handle === screen1) {\n      console.log('Screen 1 went to', state, handle);\n    }\n    if (handle === screen2) {\n      console.log('Screen 2 went to', state, handle);\n    }\n  }, [screen1, screen2]);\n  \n  return (\n    \u003cdiv\u003e\n      \u003cbutton onClick={screen1.enter}\u003e\n        First\n      \u003c/button\u003e\n\n      \u003cbutton onClick={screen2.enter}\u003e\n        Second\n      \u003c/button\u003e\n\n      \u003cFullscreen handle={screen1} onChange={reportChange}\u003e\n        \u003cdiv className=\"full-screenable-node\" style={{background: \"red\"}}\u003e\n          First\n          \u003cbutton onClick={screen1.exit}\u003e\n            Exit\n          \u003c/button\u003e\n        \u003c/div\u003e\n      \u003c/Fullscreen\u003e\n\n      \u003cFullscreen handle={screen2} onChange={reportChange}\u003e\n        \u003cdiv className=\"full-screenable-node\" style={{background: \"green\"}}\u003e\n          Second\n          \u003cbutton onClick={screen2.exit}\u003e\n            Exit\n          \u003c/button\u003e\n        \u003c/div\u003e\n      \u003c/Fullscreen\u003e\n    \u003c/div\u003e\n  );\n};\n\nexport default App;\n```\n\n## 📚 Documentation\n\n### 📖 useFullscreen\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eReturned\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003cthead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eactive\u003c/td\u003e\n      \u003ctd\u003eboolean\u003c/td\u003e\n      \u003ctd\u003etrue if this element is currently full screen.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eenter\u003c/td\u003e\n      \u003ctd\u003e() =\u003e void\u003c/td\u003e\n      \u003ctd\u003eRequests this element to go full screen.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eexit\u003c/td\u003e\n      \u003ctd\u003e\u003e() =\u003e void\u003c/td\u003e\n      \u003ctd\u003eRequests this element to exit full screen.\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n### 📖 Fullscreen\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eProp\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eRequire\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003cthead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ehandle\u003c/td\u003e\n      \u003ctd\u003eUseFullscreenProps\u003c/td\u003e\n      \u003ctd\u003e✔️\u003c/td\u003e\n      \u003ctd\u003eHandle that helps operate the full screen state.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eonChange\u003c/td\u003e\n      \u003ctd\u003e(state: boolean, handle: FullscreenHandle) =\u003e void\u003c/td\u003e\n      \u003ctd\u003e❌\u003c/td\u003e\n      \u003ctd\u003eOptional callback that gets called when this screen changes state.\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## 💖 Wrap Up\n\nIf you think any of the `react-fullscreen-html` can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.\n\n## 🌟 Contribution\n\nWe'd love to have your helping hand on contributions to `react-fullscreen-html` by forking and sending a pull request!\n\nYour contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)\n\nHow to contribute:\n\n- Open pull request with improvements\n- Discuss ideas in issues\n- Spread the word\n- Reach out with any feedback\n\n## ⚖️ License\n\nThe MIT License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunlong%2Freact-fullscreen-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbunlong%2Freact-fullscreen-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunlong%2Freact-fullscreen-html/lists"}