{"id":21169555,"url":"https://github.com/polymerelements/iron-a11y-keys","last_synced_at":"2025-07-09T19:31:48.961Z","repository":{"id":32004644,"uuid":"35575604","full_name":"PolymerElements/iron-a11y-keys","owner":"PolymerElements","description":"A basic element implementation of iron-a11y-keys-behavior","archived":false,"fork":false,"pushed_at":"2023-10-16T14:05:09.000Z","size":1776,"stargazers_count":19,"open_issues_count":11,"forks_count":22,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-11-20T15:52:08.325Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PolymerElements.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-13T21:41:18.000Z","updated_at":"2021-06-28T20:01:52.000Z","dependencies_parsed_at":"2024-06-18T15:17:12.145Z","dependency_job_id":"901907ab-915e-470a-80f5-aa400e2a58b2","html_url":"https://github.com/PolymerElements/iron-a11y-keys","commit_stats":{"total_commits":105,"total_committers":24,"mean_commits":4.375,"dds":0.7142857142857143,"last_synced_commit":"8c8dd2956a25ee3eb0895fdd917947fda11a7174"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-a11y-keys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-a11y-keys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-a11y-keys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-a11y-keys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolymerElements","download_url":"https://codeload.github.com/PolymerElements/iron-a11y-keys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225587811,"owners_count":17492632,"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":[],"created_at":"2024-11-20T15:52:30.502Z","updated_at":"2024-11-20T15:52:31.372Z","avatar_url":"https://github.com/PolymerElements.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Published on NPM](https://img.shields.io/npm/v/@polymer/iron-a11y-keys.svg)](https://www.npmjs.com/package/@polymer/iron-a11y-keys)\n[![Build status](https://travis-ci.org/PolymerElements/iron-a11y-keys.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-a11y-keys)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/iron-a11y-keys)\n\n## \u0026lt;iron-a11y-keys\u0026gt;\n`iron-a11y-keys` provides a cross-browser interface for processing\nkeyboard commands. The interface adheres to [WAI-ARIA best\npractices](http://www.w3.org/TR/wai-aria-practices/#kbd_general_binding).\nIt uses an expressive syntax to filter key presses.\n\nSee: [Documentation](https://www.webcomponents.org/element/@polymer/iron-a11y-keys),\n  [Demo](https://www.webcomponents.org/element/@polymer/iron-a11y-keys/demo/demo/index.html).\n\n## Usage\n\n### Installation\n```\nnpm install --save @polymer/iron-a11y-keys\n```\n\n### In an html file\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@polymer/iron-a11y-keys/iron-a11y-keys.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ciron-a11y-keys id=\"keys\" keys=\"left right down up\"\u003e\u003c/iron-a11y-keys\u003e\n\n    \u003cscript\u003e\n      // Where to listen for the keys.\n      keys.target = document.body;\n      keys.addEventListener('keys-pressed', function(event) {\n        console.log(event.detail);\n      });\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n### In a Polymer 3 element\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@polymer/iron-a11y-keys/iron-a11y-keys.js';\n\nclass SampleElement extends PolymerElement {\n  static get properties() {\n    return {\n      target: {\n        type: Object,\n        value: function() {\n          return this.$.input;\n        }\n      },\n    }\n  }\n\n  static get template() {\n    return html`\n      \u003ciron-a11y-keys id=\"a11y\"\n          target=\"[[target]]\" keys=\"enter\"\n          on-keys-pressed=\"onEnter\"\u003e\u003c/iron-a11y-keys\u003e\n      \u003cinput id=\"input\" placeholder=\"Type something. Press enter. Check console.\"\u003e\n    `;\n  }\n\n  function onEnter() {\n    console.log(this.userInput);\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n## Contributing\nIf you want to send a PR to this element, here are\nthe instructions for running the tests and demo locally:\n\n### Installation\n```sh\ngit clone https://github.com/PolymerElements/iron-a11y-keys\ncd iron-a11y-keys\nnpm install\nnpm install -g polymer-cli\n```\n\n### Running the demo locally\n```sh\npolymer serve --npm\nopen http://127.0.0.1:\u003cport\u003e/demo/\n```\n\n### Running the tests\n```sh\npolymer test --npm\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-a11y-keys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymerelements%2Firon-a11y-keys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-a11y-keys/lists"}