{"id":13402650,"url":"https://github.com/hybridsjs/hybrids","last_synced_at":"2026-01-07T14:16:58.897Z","repository":{"id":39568506,"uuid":"75767776","full_name":"hybridsjs/hybrids","owner":"hybridsjs","description":"Extraordinary JavaScript UI framework with unique declarative and functional architecture","archived":false,"fork":false,"pushed_at":"2025-03-24T14:32:39.000Z","size":3338,"stargazers_count":3100,"open_issues_count":7,"forks_count":86,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-05-11T15:37:33.587Z","etag":null,"topics":["framework","localization","router","state-management","webcomponents"],"latest_commit_sha":null,"homepage":"https://hybrids.js.org","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/hybridsjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2016-12-06T20:19:43.000Z","updated_at":"2025-05-11T04:31:59.000Z","dependencies_parsed_at":"2024-01-29T13:05:00.525Z","dependency_job_id":"1af9c32f-8d11-4b20-8c4f-0305c62e635e","html_url":"https://github.com/hybridsjs/hybrids","commit_stats":{"total_commits":829,"total_committers":23,"mean_commits":36.04347826086956,"dds":"0.039806996381182125","last_synced_commit":"2b89312affc5b1ab03025dcec48c03daa5b58e32"},"previous_names":[],"tags_count":148,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hybridsjs%2Fhybrids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hybridsjs%2Fhybrids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hybridsjs%2Fhybrids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hybridsjs%2Fhybrids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hybridsjs","download_url":"https://codeload.github.com/hybridsjs/hybrids/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253766650,"owners_count":21960962,"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":["framework","localization","router","state-management","webcomponents"],"created_at":"2024-07-30T19:01:18.917Z","updated_at":"2026-01-07T14:16:58.868Z","avatar_url":"https://github.com/hybridsjs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","*.js","Libraries","Similar libraries","framework","localization"],"sub_categories":["Browser","Functional","Other Tools"],"readme":"\n\u003ch1 align=\"center\"\u003e\n  \u003cimg alt=\"hybrids\" src=\"https://raw.githubusercontent.com/hybridsjs/hybrids/main/docs/assets/hybrids-full-logo.svg?sanitize=true\"\u003e\n\u003c/h1\u003e\n\n[![build status](https://github.com/hybridsjs/hybrids/actions/workflows/test.yml/badge.svg)](https://github.com/hybridsjs/hybrids/actions/workflows/test.yml?query=branch%3Amain)\n[![coverage status](https://coveralls.io/repos/github/hybridsjs/hybrids/badge.svg?branch=main)](https://coveralls.io/github/hybridsjs/hybrids?branch=main)\n[![npm version](https://img.shields.io/npm/v/hybrids.svg?style=flat)](https://www.npmjs.com/package/hybrids)\n\n\u003e An extraordinary JavaScript framework for creating client-side web applications, UI components libraries, or single web components with unique mixed declarative and functional architecture\n\n**Hybrids** provides a complete set of features for building modern web applications:\n\n* **Component Model** based on plain objects and pure functions\n* **Global State Management** with external storages, offline caching, relations, and more\n* **App-like Routing** based on the graph structure of views\n* **Layout Engine** making UI layouts development much faster\n* **Localization** with automatic translation of the templates content\n* **Hot Module Replacement** support without any additional configuration\n\n### Documentation\n\nThe project documentation is available at the [hybrids.js.org](https://hybrids.js.org) site.\n\n## Quick Look\n\n### Component Model\n\nIt's based on plain objects and pure functions[^1], still using the [Web Components API](https://developer.mozilla.org/en-US/docs/Web/Web_Components) under the hood:\n\n```javascript\nimport { html, define } from \"hybrids\";\n  \nfunction increaseCount(host) {\n  host.count += 1;\n}\n\nexport default define({\n  tag: \"simple-counter\",\n  count: 0,\n  render: ({ count }) =\u003e html`\n    \u003cbutton onclick=\"${increaseCount}\"\u003e\n      Count: ${count}\n    \u003c/button\u003e\n  `,\n});\n```\n\n```html\n\u003csimple-counter count=\"42\"\u003e\u003c/simple-counter\u003e\n```\n\n[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/hybrids-simple-counter)\n\nYou can read more in the [Component Model](https://hybrids.js.org/#/component-model/definition.md) section.\n\n### Global State Management\n\nA global state management uses declarative model definitions with support for async external storages, relations, offline caching, and many more:\n\n```javascript\nimport { define, store, html } from \"hybrids\";\n\nconst User = {\n  id: true,\n  firstName: \"\",\n  lastName: \"\",\n  [store.connect] : {\n    get: id =\u003e fetch(`/users/${id}`).then(...),\n  },\n};\n\ndefine({\n  tag: \"user-details\",\n  user: store(User),\n  render: ({ user }) =\u003e html`\n    \u003cdiv\u003e\n      ${store.pending(user) \u0026\u0026 `Loading...`}\n      ${store.error(user) \u0026\u0026 `Something went wrong...`}\n\n      ${store.ready(user) \u0026\u0026 html`\n        \u003cp\u003e${user.firstName} ${user.lastName}\u003c/p\u003e\n      `}\n    \u003c/div\u003e\n  `,\n});\n```\n\n```html\n\u003cuser-details user=\"2\"\u003e\u003c/user-details\u003e\n```\n\nYou can read more in the [Store](https://hybrids.js.org/#/store/usage.md) section.\n\n### App-like Routing\n\nRather than just matching URLs with the corresponding components, the router depends on a tree-like structure of views, which have their own routing configuration. It makes the URLs optional, have out-the-box support for dialogs, protected views, and many more.\n\n```javascript\nimport { define, html, router } from \"hybrids\";\n\nimport Details from  \"./details.js\";\n\nconst Home = define({\n  [router.connect]: { stack: [Details, ...] },\n  tag: \"app-home\",\n  render: () =\u003e html`\n    \u003ctemplate layout=\"column\"\u003e\n      \u003ch1\u003eHome\u003c/h1\u003e\n      \u003cnav layout=\"row gap\"\u003e\n        \u003ca href=\"${router.url(Details)}\"\u003eDetails\u003c/a\u003e\n      \u003c/nav\u003e\n      ...\n    \u003c/template\u003e  \n  `,\n});\n\nexport define({\n  tag: \"app-router\",\n  stack: router(Home),\n  render: ({ stack }) =\u003e html`\n    \u003ctemplate layout=\"column\"\u003e\n      ${stack}\n    \u003c/template\u003e\n  `,\n});\n```\n\n```html\n\u003capp-router\u003e\u003c/app-router\u003e\n```\n\nYou can read more in the [Router](https://hybrids.js.org/#/router/usage.md) section.\n\n### Layout Engine\n\nCreate CSS layouts in-place in templates, even without using Shadow DOM, but still keeping the encapsulation of the component's styles:\n\n```javascript\ndefine({\n  tag: \"app-home-view\",\n  render: () =\u003e html`\n    \u003ctemplate layout=\"column center gap:2\"\u003e\n      \u003cdiv layout=\"grow grid:1|max\"\u003e\n        \u003ch1\u003eHome\u003c/h1\u003e\n        ...\n      \u003c/div\u003e\n\n      \u003cfooter layout@768px=\"hidden\"\u003e...\u003c/footer\u003e\n    \u003c/template\u003e\n  `\n});\n```\n\nYou can read more in the [Layout Engine](https://hybrids.js.org/#/component-model/layout-engine.md) section of the documentation.\n\n### Localization\n\nThe library supports automatic translation of the component's content, which makes translation seamless and easy to integrate. Additionally, it provides a way to add dynamic messages with plural forms, HTML content, or use messages outside of the template context. Also, it comes with handy CLI tool to extract messages from the source code!\n\n```javascript\nimport { define, html, localize } from \"hybrids\";\n\nexport default define({\n  tag: \"my-element\",\n  name: \"\",\n  render: ({ name }) =\u003e html`\n    \u003cdiv\u003eHello ${name}!\u003c/div\u003e\n  `,\n});\n\nlocalize(\"pl\", {\n  \"Hello ${0}!\": {\n    message: \"Witaj ${0}!\",\n  },\n});\n```\n\nYou can read more in the [Localization](https://hybrids.js.org/#/component-model/localization.md) section of the documentation.\n\n## Community\n\nDo you need help? Something went wrong? Feel free to create [an issue](https://github.com/hybridsjs/hybrids/issues/new) in the github repository or join the [Gitter](https://gitter.im/hybridsjs/hybrids) channel.\n\n## License\n\n**Hybrids** is released under the [MIT License](LICENSE).\n\n[^1]: Pure functions only apply to the component definition. Side effects attached to event listeners might mutate the host element.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhybridsjs%2Fhybrids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhybridsjs%2Fhybrids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhybridsjs%2Fhybrids/lists"}