{"id":15046820,"url":"https://github.com/polymerelements/iron-menu-behavior","last_synced_at":"2025-04-12T18:53:17.819Z","repository":{"id":30988644,"uuid":"34546968","full_name":"PolymerElements/iron-menu-behavior","owner":"PolymerElements","description":"Accessible menu behavior","archived":false,"fork":false,"pushed_at":"2025-01-29T20:28:37.000Z","size":398,"stargazers_count":18,"open_issues_count":20,"forks_count":28,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-03T22:08:19.838Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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-04-24T23:31:47.000Z","updated_at":"2021-06-22T02:34:33.000Z","dependencies_parsed_at":"2024-06-18T14:05:41.127Z","dependency_job_id":"626cd8f8-93b2-497f-9de6-8415ff4e11ef","html_url":"https://github.com/PolymerElements/iron-menu-behavior","commit_stats":{"total_commits":198,"total_committers":27,"mean_commits":7.333333333333333,"dds":0.6868686868686869,"last_synced_commit":"44abe29097c6244a1ec127a86c289bfc56ac1877"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-menu-behavior","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-menu-behavior/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-menu-behavior/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-menu-behavior/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolymerElements","download_url":"https://codeload.github.com/PolymerElements/iron-menu-behavior/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618244,"owners_count":21134200,"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-09-24T20:53:37.293Z","updated_at":"2025-04-12T18:53:17.798Z","avatar_url":"https://github.com/PolymerElements.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Published on NPM](https://img.shields.io/npm/v/@polymer/iron-menu-behavior.svg)](https://www.npmjs.com/package/@polymer/iron-menu-behavior)\n[![Build status](https://travis-ci.org/PolymerElements/iron-menu-behavior.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-menu-behavior)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/iron-menu-behavior)\n\n## `IronMenuBehavior`, `IronMenubarBehavior`\n\n`IronMenuBehavior` and `IronMenubarBehavior` implement accessible menu and\nmenubar behaviors.\n\nSee: [Documentation](https://www.webcomponents.org/element/@polymer/iron-menu-behavior),\n  [Demo](https://www.webcomponents.org/element/@polymer/iron-menu-behavior/demo/demo/index.html).\n\n## Usage\n\n### Installation\n\n```\nnpm install --save @polymer/iron-menu-behavior\n```\n\n### In a Polymer 3 element\n\n```js\nimport {PolymerElement} from '@polymer/polymer/polymer-element.js';\nimport {mixinBehaviors} from '@polymer/polymer/lib/legacy/class.js';\nimport {html} from '@polymer/polymer/lib/utils/html-tag.js';\n\nimport {IronMenuBehavior} from '@polymer/iron-menu-behavior/iron-menu-behavior.js';\n\nclass SimpleMenu extends mixinBehaviors(IronMenuBehavior, PolymerElement) {\n  static get template() {\n    return html`\n      \u003cstyle\u003e\n        :host \u003e ::slotted(*) {\n          display: block;\n        }\n\n        :host \u003e ::slotted(.iron-selected) {\n          color: white;\n          background-color: var(--google-blue-500);\n        }\n      \u003c/style\u003e\n\n      \u003cslot\u003e\u003c/slot\u003e\n    `;\n  }\n}\n\ncustomElements.define('simple-menu', SimpleMenu);\n```\n\nThen, in your HTML:\n\n```html\n\u003cscript type=\"module\" src=\"./simple-menu.js\"\u003e\u003c/script\u003e\n\n\u003cstyle\u003e\nsimple-menu .iron-selected {\n  background-color: blue;\n  color: white;\n}\n\u003c/style\u003e\n\n\u003csimple-menu\u003e\n  \u003cdiv role=\"menuitem\"\u003eItem 0\u003c/div\u003e\n  \u003cdiv role=\"menuitem\"\u003eItem 1\u003c/div\u003e\n  \u003cdiv role=\"menuitem\" disabled aria-disabled=\"true\"\u003eItem 2 (disabled)\u003c/div\u003e\n\u003c/simple-menu\u003e\n```\n\n## Contributing\n\nIf you want to send a PR to this element, here are the instructions for running\nthe tests and demo locally:\n\n### Installation\n\n```sh\ngit clone https://github.com/PolymerElements/iron-menu-behavior\ncd iron-menu-behavior\nnpm install\nnpm install -g polymer-cli\n```\n\n### Running the demo locally\n\n```sh\npolymer serve --npm\nopen http://127.0.0.1:\u003cport\u003e/demo/\n```\n\n### Running the tests\n\n```sh\npolymer test --npm\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-menu-behavior","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymerelements%2Firon-menu-behavior","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-menu-behavior/lists"}