{"id":20513831,"url":"https://github.com/webreflection/custom-tag","last_synced_at":"2025-04-14T00:01:36.274Z","repository":{"id":65993147,"uuid":"78680130","full_name":"WebReflection/custom-tag","owner":"WebReflection","description":"The simplest way to define Custom Elements.","archived":false,"fork":false,"pushed_at":"2017-01-25T10:53:25.000Z","size":16,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T14:11:09.426Z","etag":null,"topics":["customelements","definition","init","simple"],"latest_commit_sha":null,"homepage":"","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/WebReflection.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2017-01-11T21:10:41.000Z","updated_at":"2024-11-03T10:22:03.000Z","dependencies_parsed_at":"2023-05-21T16:45:22.722Z","dependency_job_id":null,"html_url":"https://github.com/WebReflection/custom-tag","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":0.4782608695652174,"last_synced_commit":"7a514345f2a92c9056286585ce3c96c3e3a922fb"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fcustom-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fcustom-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fcustom-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fcustom-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebReflection","download_url":"https://codeload.github.com/WebReflection/custom-tag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799931,"owners_count":21163403,"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":["customelements","definition","init","simple"],"created_at":"2024-11-15T21:13:21.257Z","updated_at":"2025-04-14T00:01:36.220Z","avatar_url":"https://github.com/WebReflection.png","language":"JavaScript","readme":"# CustomTag\n\nThe simplest way to define Custom Elements.\n\nBased on [Classtrophobic](https://github.com/WebReflection/classtrophobic),\n[safely usable](https://medium.com/@WebReflection/a-case-for-js-classes-without-classes-9e60b3b5992#.iof2l3x2b) before or after Babel transpilation.\n\n### API\n```js\nconst MyButton = CustomTag({\n  // registered automatically with a name\n  name: 'my-button',\n\n  // supports native extends too\n  extends: 'button',\n  // extends: 'my-prev-comp'\n  // extends: HTMLButtonEmenent (or others)\n\n  // list of properties to watch/observe\n  watch: ['one', 'or-more', 'attributes'],\n  // automatically reflected through the element too\n  // this.one = 1; // triggers changes with string value '1'\n\n  // invoked once per each component\n  // fully customizable once invoked\n  onInit() {\n    this.textContent = this.nodeName; // BUTTON\n    this.on('click', console.log);\n  },\n\n  // invoked on adopt, connect, disconnect, changes\n  onAdopt() {},\n  onConnect() {},\n  onDisconnect() {},\n  onChange(prop, prev, curr) {},\n\n  // any other method, getter, or static\n  // what you can define with classtrophobic\n  // will work out of the box in here too\n  on(...args) {\n    this.addEventListener(...args);\n    return this;\n  }\n});\n```\n\n(C) 2017 Andrea Giammarchi - MIT Style License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fcustom-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebreflection%2Fcustom-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fcustom-tag/lists"}