# react-easter-egg

> A react component to add keyboard based easter eggs

Latest version **0.1.1** (published 2016-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-easter-egg
pnpm add react-easter-egg
yarn add react-easter-egg
bun add react-easter-egg
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-08-26 |
| First published | 2016-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Edouard Eynard |
| Maintainers | eeynard |
| Keywords | konami, react-component, component, easter-egg, react |

## Links

- npm: https://www.npmjs.com/package/react-easter-egg
- Repository: https://github.com/eeynard/react-easter-egg
- Issues: https://github.com/eeynard/react-easter-egg/issues
- npm.io page: https://npm.io/package/react-easter-egg

## Dependencies (1)

- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.6.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2016-08-26

## README

# react-easter-egg

## Installation
```
npm install react-easter-egg --save
```

## Props
| Key       | Value    | Default     | Required | Description                                                     |
|-----------|----------|:-----------:|:--------:|-----------------------------------------------------------------|
| callback  | function | undefined   | No       | A callback triggered when the user has entered the code         |
| className | string   | ''          | No       | A class to assign to the wrapper div when a child is specified  |
| disable   | boolean  | false       | No       | If set to true, the easter egg will be disabled                 |
| code      | array    | Konami code | No       | An array of integer representing the keyboard sequence to catch |


## Usage
First you need to import the component :
```javascript
import EasterEgg from 'react-easter-egg';
```

### Display sub component
```javascript
<EasterEgg>
    <p>Text to display when the code is entered</p>
</EasterEgg>
```
### Trigger callback
```javascript
<EasterEgg callback={() => { alert('Hello world !'); }} />
```

## Examples
### Material ui Dialog
```javascript
import React from 'react';
import Dialog from 'material-ui/Dialog';
import EasterEgg from 'react-easter-egg';

export class KonamiCodeDialog extends React.Component {

    state = { open: false };

    handleOpen = () => {
        this.setState({ open: true });
    };

    handleClose = () => {
        this.setState({ open: false });
    };

    render() {
        return <EasterEgg callback={this.handleOpen}>
            <Dialog
                modal={false}
                open={this.state.open}
                onRequestClose={this.handleClose}>

                <iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameBorder="0" allowFullScreen></iframe>

            </Dialog>
        </EasterEgg>
    }

}

export default KonamiCodeDialog;
```

## License

MIT

---
_Source: https://npm.io/package/react-easter-egg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
