{"id":13630543,"url":"https://github.com/aaronshaf/totes","last_synced_at":"2026-03-05T23:15:13.862Z","repository":{"id":57094002,"uuid":"144044107","full_name":"aaronshaf/totes","owner":"aaronshaf","description":"React-like web components","archived":false,"fork":false,"pushed_at":"2018-10-17T05:33:27.000Z","size":284,"stargazers_count":15,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T18:09:57.546Z","etag":null,"topics":["components","lit-html","react"],"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/aaronshaf.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}},"created_at":"2018-08-08T17:05:05.000Z","updated_at":"2024-10-26T20:50:09.000Z","dependencies_parsed_at":"2022-08-22T21:40:48.591Z","dependency_job_id":null,"html_url":"https://github.com/aaronshaf/totes","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronshaf%2Ftotes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronshaf%2Ftotes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronshaf%2Ftotes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronshaf%2Ftotes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaronshaf","download_url":"https://codeload.github.com/aaronshaf/totes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931555,"owners_count":21827112,"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":["components","lit-html","react"],"created_at":"2024-08-01T22:01:46.591Z","updated_at":"2026-03-05T23:15:08.844Z","avatar_url":"https://github.com/aaronshaf.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# totes\n\nReact-like web components. Powered by [lit-html](https://github.com/Polymer/lit-html).\n\nSupports:\n\n- [x] setState\n- [x] render\n- [x] componentDidMount\n- [x] shouldComponentUpdate\n- [x] getSnapshotBeforeUpdate\n- [x] component[Did]Unmount\n- [x] componentDidUpdate\n- [x] getDerivedStateFromProps\n- [x] this.props.children\n\n## Quick start (copy and paste)\n\n```html\n\u003cscript type=\"module\"\u003e\n  import { html, Component } from \"https://unpkg.com/@aaronshaf/totes@1/index.js\";\n\n  class HelloWorld extends Component {\n    render() {\n      return html`\u003cdiv\u003eHello, ${this.props.name}\u003c/div\u003e`;\n    }\n  }\n\n  customElements.define(\"hello-world\", HelloWorld);\n\u003c/script\u003e\n\n\u003chello-world name=\"Aaron\"\u003e\u003c/hello-world\u003e\n```\n\nThat's it. No build steps.️ 🎵\n\n## Example: setState and event handlers\n\n```javascript\nexport default class BasicExample extends Component {\n  static get observedAttributes() {\n    return [\"message\"];\n  }\n\n  constructor() {\n    super();\n    this.state = {\n      name: \"Aaron\",\n      toggled: false\n    };\n  }\n\n  handleInput(event) {\n    this.setState({ name: event.target.value || \"Aaron\" });\n  }\n\n  handleClick() {\n    this.setState({ toggled: this.state.toggled === false });\n  }\n\n  render() {\n    return html`\u003cdiv\u003e\n      \u003cdiv\u003e\n        \u003cinput\n          type=\"text\"\n          value=\"Aaron\"\n          @input=${this.handleInput}\n        /\u003e\n      \u003c/div\u003e\n\n      \u003cp\u003e${this.props.message} ${this.state.name}\u003c/p\u003e\n\n      \u003cbutton @click=${this.handleClick}\u003e\n        ${this.state.toggled ? \"On\" : \"Off\"}\n      \u003c/button\u003e\n    \u003c/div\u003e`;\n  }\n}\n\ncustomElements.define(\"basic-example\", BasicExample);\n```\n\n```html\n\u003cbasic-example message=\"Hello\"\u003e\u003c/basic-example\u003e\n```\n\n## Install from npm\n\n```\nyarn add @aaronshaf/totes --prod\n```\n\n## Try it on Glitch\n\n[totes-example](https://glitch.com/edit/#!/totes-example?path=hello-world.html:1:0)\n\n## Supported browsers\n\n- [x] Chrome (without polyfill)\n- [x] Firefox\n- [x] Safari\n- [x] Edge\n\n### Custom elements / Shadow DOM polyfill\n\n```html\n\u003cscript src=\"https://unpkg.com/@webcomponents/webcomponentsjs@2.1.3/webcomponents-loader.js\"\u003e\u003c/script\u003e\n```\n\n## Dev\n\n`git clone https://github.com/aaronshaf/totes.git`\n\n`yarn global add serve`\n\n`serve`\n\n## See also\n\n- [html-router](https://github.com/aaronshaf/html-router) - drop-in router\n- [dem](https://github.com/aaronshaf/dem) - download ECMAScript modules\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronshaf%2Ftotes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronshaf%2Ftotes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronshaf%2Ftotes/lists"}