{"id":19889633,"url":"https://github.com/moimikey/react-konamikey","last_synced_at":"2025-05-02T17:33:47.481Z","repository":{"id":47699612,"uuid":"115148784","full_name":"moimikey/react-konamikey","owner":"moimikey","description":"💅🏻 trigger a callback function on anything with a sequence of key presses","archived":false,"fork":false,"pushed_at":"2023-10-25T22:06:11.000Z","size":492,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-31T17:56:04.513Z","etag":null,"topics":["keypress","konami","konamicode","react","react-component","react-components"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/moimikey.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}},"created_at":"2017-12-22T20:41:37.000Z","updated_at":"2023-10-25T16:57:55.000Z","dependencies_parsed_at":"2022-08-22T04:00:32.031Z","dependency_job_id":null,"html_url":"https://github.com/moimikey/react-konamikey","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moimikey%2Freact-konamikey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moimikey%2Freact-konamikey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moimikey%2Freact-konamikey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moimikey%2Freact-konamikey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moimikey","download_url":"https://codeload.github.com/moimikey/react-konamikey/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224324404,"owners_count":17292521,"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":["keypress","konami","konamicode","react","react-component","react-components"],"created_at":"2024-11-12T18:10:58.911Z","updated_at":"2024-11-12T18:10:58.990Z","avatar_url":"https://github.com/moimikey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-konamikey [![CircleCI](https://circleci.com/gh/moimikey/react-konamikey/tree/master.svg?style=svg)](https://circleci.com/gh/moimikey/react-konamikey/tree/master)\n\nTrigger a callback function on anything with a sequence of key presses.\n\n## Install\n\n```bash\n# requires react@\u003e=16\nyarn add react-konamikey\n```\n\n## Usage\n```jsx\nimport * as React from 'react'\nimport Konami from 'react-konamikey'\n// const Konami = require('react-konamikey').default\n```\n\n### attach to an element (using `refFn`)\n\n```jsx\n\u003cKonami\n  element={({ refFn }) =\u003e (\n    \u003cinput type=\"text\" placeholder=\"gamma\" ref={refFn} /\u003e\n  )}\n  payload={() =\u003e console.log('KONAMI!!!')}\n  sequence={['g', 'a', 'm', 'm', 'a']}\n/\u003e\n```\n\n### attach to `document`\n\n```jsx\n\u003cKonami\n  element={document}\n  payload={() =\u003e console.log('KONAMI!!!')}\n  sequence={['a', 'b', 'c']}\n\u003e\n  \u003cdiv\u003ehello world\u003c/div\u003e\n\u003c/Konami\u003e\n```\n\n### live example\n\nhttps://codesandbox.io/s/blissful-pare-c7hvb\n\n## Props\n\n### element\n\nType: _HTMLElement_ | _Function_\n\nAn HTMLElement, document, or function to attach `keydown` event handlers to.\n\n### payload\n\nType: _Function_\n\nA payload function to execute, once the Konami sequence has been fulfilled.\n\n### sequence\n\nType: _Array [required]_\n\nAn array of strings representing key names.\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoimikey%2Freact-konamikey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoimikey%2Freact-konamikey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoimikey%2Freact-konamikey/lists"}