{"id":15099289,"url":"https://github.com/nostrangerdev/jpad-components","last_synced_at":"2026-02-15T05:31:58.159Z","repository":{"id":224428111,"uuid":"763226993","full_name":"nostrangerdev/jpad-components","owner":"nostrangerdev","description":"A set of web-components to build declarative virtual gamepad layouts","archived":false,"fork":false,"pushed_at":"2024-12-18T09:22:32.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T09:00:03.464Z","etag":null,"topics":["gamedev","gamepad","gamepad-library","joypad","library","prototyping","ui-components","web-components"],"latest_commit_sha":null,"homepage":"https://nostrangerdev.github.io/jpad-components/","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/nostrangerdev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-25T21:45:15.000Z","updated_at":"2024-12-18T09:22:36.000Z","dependencies_parsed_at":"2024-09-15T17:22:28.005Z","dependency_job_id":null,"html_url":"https://github.com/nostrangerdev/jpad-components","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"14f92ffa90a16b1ef725e7748ad0ae5bebbb688c"},"previous_names":["nostrangerdev/jpad-components"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nostrangerdev/jpad-components","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nostrangerdev%2Fjpad-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nostrangerdev%2Fjpad-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nostrangerdev%2Fjpad-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nostrangerdev%2Fjpad-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nostrangerdev","download_url":"https://codeload.github.com/nostrangerdev/jpad-components/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nostrangerdev%2Fjpad-components/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278342128,"owners_count":25971393,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["gamedev","gamepad","gamepad-library","joypad","library","prototyping","ui-components","web-components"],"created_at":"2024-09-25T17:09:31.374Z","updated_at":"2025-10-04T16:29:38.961Z","avatar_url":"https://github.com/nostrangerdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \\\u003cjpad-components\u003e\n\n![NPM Version](https://img.shields.io/npm/v/jpad-components)\n![GitHub License](https://img.shields.io/github/license/nostrangerdev/jpad-components)\n\nA set of web-components to build declarative virtual gamepad layouts.\n\nThe aim of this project is to enable rapid prototyping and to provide a simple way of implementing touch / keyboard inputs without having to write custom UI code.\n\nThe jpad-components are designed to work with any framework and game engine, you can use the `jpad-controller` API directly in your game loop or listen to the controller, trackpad or button events as needed.\n\n## Installation\n\njpad-components is available on [npm](https://www.npmjs.com/package/jpad-components):\n\n```sh\nnpm i jpad-components\n```\n\n## Usage\n\nImport the components separately or as a bundle:\n\n```js\n// import as a bundle\nimport 'jpad-components'; // Load all elements in one go\n\n// or just the components you need\nimport 'jpad-components/jpad-controller.js'; // Layout controller and simple API\nimport 'jpad-components/jpad-tile.js'; // Create familiar button layouts\nimport 'jpad-components/jpad-button.js'; // Handle input as a button or trigger\nimport 'jpad-components/jpad-trackpad.js'; // Handle movement in any direction\n```\n\n```html\n\u003c!-- available on CDN too --\u003e\n\u003chead\u003e\n  ...\n  \u003cscript src=\"https://esm.run/jpad-components\" type=\"module\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n```\n\nThe components API is [documented here](https://nostrangerdev.github.io/jpad-components#docs).\n\nHere's a minimal example:\n\n```html\n\u003c!-- Define the layout --\u003e\n\u003cjpad-controller\u003e\n    \u003cjpad-trackpad\n      name=\"movement\"\n      upkeys=\"ArrowUp, KeyW\"\n      downkeys=\"ArrowDown, KeyS\"\n      leftkeys=\"ArrowLeft, KeyA\"\n      rightkeys=\"ArrowRight, KeyD\"\n      slot=\"left\"\n    \u003e\u003c/jpad-trackpad\u003e\n\n    \u003cjpad-tile slot=\"right\"\u003e\n      \u003cjpad-button passby name=\"jump\" keys=\"Z\"\u003eZ\u003c/jpad-button\u003e\n      \u003cjpad-button passby name=\"attack\" keys=\"X\"\u003eX\u003c/jpad-button\u003e\n    \u003c/jpad-tile\u003e\n\u003c/jpad-controller\u003e\n\n\u003cscript\u003e\n  // Get the element\n  const jpad = document.querySelector('jpad-controller');\n\n  // Use it with the input api\n  jpad.getAxis('movement');\n  jpad.isPressed('attack');\n  jpad.isJustPressed('attack');\n\n  // You can also listen for the events\n  jpad.addEventListener('buttontrigger', (e) =\u003e {\n    console.log(e.detail.name, e.detail.pressed);\n  });\n  jpad.addEventListener('trackpadmove', (e) =\u003e {\n    console.log(e.detail.name, e.detail.axis);\n  });\n\u003c/script\u003e\n```\n\n## Some examples in the wild\n\nHere's some demos that use `jpad-components` to handle their inputs:\n\n- [Playable CSS 3D Drone](https://codepen.io/nostranger/pen/abxzVKy)\n\n## License\n\nThis project is released under the [MIT license](https://github.com/nostrangerdev/jpad-components/blob/main/LICENSE).\n\n## Contributions\n\nAny contribution or feedback is warmly welcomed, this project has been tested on a limited set of devices and browsers and might display some bugs.\n\n## If you need support or found a bug\n\nIf you need and help or have found a bug, feel free to [leave an issue](https://github.com/nostrangerdev/jpad-components/issues) or [DM me on Nostr](https://njump.me/nostranger@nostrcheck.me).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnostrangerdev%2Fjpad-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnostrangerdev%2Fjpad-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnostrangerdev%2Fjpad-components/lists"}