Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andrelmlins/preact-fullscreen

Component that performs fullscreen in DOM Elements
https://github.com/andrelmlins/preact-fullscreen

fullscreen preact

Last synced: about 1 month ago
JSON representation

Component that performs fullscreen in DOM Elements

Awesome Lists containing this project

README

        

# Preact Fullscreen

[![npm version](https://badge.fury.io/js/preact-fullscreen.svg)](https://www.npmjs.com/package/preact-fullscreen) • [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/andrelmlins/preact-fullscreen/blob/master/LICENSE) • [![Build Status](https://travis-ci.com/andrelmlins/preact-fullscreen.svg?branch=master)](https://travis-ci.com/andrelmlins/preact-fullscreen)

Component that performs fullscreen in DOM Elements

## Installation

```
npm i preact-fullscreen
// OR
yarn add preact-fullscreen
```

## Demo

Local demo:

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

## Examples

```jsx
import { h, render } from "preact";
import PreactFullscreeen from "preact-fullscreen";

const App = () => (

{({ ref, onRequest, onExit }) => (


onRequest()}>FullScreen
onExit()}>Screen

)}

);

render(, document.body);
```

## Properties

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

### Children Function Properties

| Prop | Type | Description |
| --------- | ------ | -------------------------- |
| ref | object | Ref dom element |
| onToggle | func | Call for fullscreen toggle |
| onExit | func | Call for fullscreen exit |
| onRequest | func | Call for fullscreen enter |

## Browsers Support

You can see the list of supported browsers [here](https://caniuse.com/fullscreen)

![Browsers support](assets/browser-support.png)

## License

Preact Fullscreen is open source software [licensed as MIT](https://github.com/andrelmlins/preact-fullscreen/blob/master/LICENSE).