{"id":21169566,"url":"https://github.com/polymerelements/paper-behaviors","last_synced_at":"2025-08-15T22:12:41.275Z","repository":{"id":30583992,"uuid":"34139070","full_name":"PolymerElements/paper-behaviors","owner":"PolymerElements","description":"Common behaviors used across paper-* elements.","archived":false,"fork":false,"pushed_at":"2024-03-12T18:04:25.000Z","size":359,"stargazers_count":19,"open_issues_count":13,"forks_count":27,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-05-09T10:09:35.739Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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-17T20:40:05.000Z","updated_at":"2024-06-18T13:57:25.255Z","dependencies_parsed_at":"2024-06-18T13:57:21.147Z","dependency_job_id":"7beeaf77-4f9f-4ec3-849d-6372766b1034","html_url":"https://github.com/PolymerElements/paper-behaviors","commit_stats":{"total_commits":171,"total_committers":36,"mean_commits":4.75,"dds":0.8011695906432749,"last_synced_commit":"91a9d11985238d51eb4312fadb81bf3edcb7d597"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Fpaper-behaviors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Fpaper-behaviors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Fpaper-behaviors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Fpaper-behaviors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolymerElements","download_url":"https://codeload.github.com/PolymerElements/paper-behaviors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640465,"owners_count":20971557,"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:31.169Z","updated_at":"2025-04-07T11:11:20.393Z","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/paper-behaviors.svg)](https://www.npmjs.com/package/@polymer/paper-behaviors)\n[![Build status](https://travis-ci.org/PolymerElements/paper-behaviors.svg?branch=master)](https://travis-ci.org/PolymerElements/paper-behaviors)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/paper-behaviors)\n\n## \u0026lt;paper-behaviors\u0026gt;\n`\u003cpaper-behaviors\u003e` is a set of behaviours to help implement Material Design elements:\n\n- `PaperCheckedElementBehavior` to implement a custom element\nthat has a `checked` property similar to `IronCheckedElementBehavior`\nand is compatible with having a ripple effect.\n- `PaperInkyFocusBehavior` implements a ripple when the element has keyboard focus.\n- `PaperRippleBehavior` dynamically implements a ripple\nwhen the element has focus via pointer or keyboard. This behavior is intended to be used in conjunction with and after\n`IronButtonState` and `IronControlState`.\n\nSee: [Documentation](https://www.webcomponents.org/element/@polymer/paper-behaviors),\n  [Demo](https://www.webcomponents.org/element/@polymer/paper-behaviors/demo/demo/index.html).\n\n## Usage\n\n### Installation\n```\nnpm install --save @polymer/paper-behaviors\n```\n\n### Example of using one of the behaviours in a Polymer 3 element\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport {mixinBehaviors} from '@polymer/polymer/lib/legacy/class.js';\nimport {PaperButtonBehavior} from '@polymer/paper-behaviors/paper-button-behavior.js';\n\nclass SampleElement extends mixinBehaviors([PaperButtonBehavior], PolymerElement) {\n  static get template() {\n    return html`\n      \u003cstyle\u003e\n        :host {\n          display: block;\n        }\n        /* Some properties inherited from the behaviour */\n        :host([disabled]) {\n          background-color: grey;\n          pointer-events: none;\n        }\n        :host([active]),\n        :host([pressed]) {\n          background-color: blue;\n        }\n      \u003c/style\u003e\n      \u003cdiv\u003eI am a ripple-y button\u003c/div\u003e\n    `;\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/paper-behaviors\ncd paper-behaviors\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%2Fpaper-behaviors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymerelements%2Fpaper-behaviors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Fpaper-behaviors/lists"}