{"id":13629880,"url":"https://github.com/0xc0Der/xuijs","last_synced_at":"2025-04-17T13:30:36.395Z","repository":{"id":57402433,"uuid":"415579200","full_name":"0xc0Der/xuijs","owner":"0xc0Der","description":"A javascript runtime library for creating reactive user interfaces.","archived":false,"fork":false,"pushed_at":"2022-03-01T17:12:42.000Z","size":44,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-02T08:45:50.140Z","etag":null,"topics":["library","reactive","runtime","ui"],"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/0xc0Der.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":"2021-10-10T12:27:25.000Z","updated_at":"2024-07-19T04:13:38.000Z","dependencies_parsed_at":"2022-09-17T07:01:52.320Z","dependency_job_id":null,"html_url":"https://github.com/0xc0Der/xuijs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xc0Der%2Fxuijs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xc0Der%2Fxuijs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xc0Der%2Fxuijs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xc0Der%2Fxuijs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xc0Der","download_url":"https://codeload.github.com/0xc0Der/xuijs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223757037,"owners_count":17197487,"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":["library","reactive","runtime","ui"],"created_at":"2024-08-01T22:01:22.797Z","updated_at":"2024-11-08T21:30:21.166Z","avatar_url":"https://github.com/0xc0Der.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Xuijs\n\nA javascript runtime library for creating reactive user interfaces.\n\n# features\n\nXuijs is a set of tools that makes it so easy to add reactivity to your UIs.\n\n- no vdom\n- very lightweight.\n- very fast.\n- unopinionated.\n- extendable to infinity.\n\n# usage\n\n1. download the package using npm.\n\n```bash\n\n$ npm i xuijs\n\n```\n\n2. define the App.\n\n```js\nimport { Xui } from 'xuijs';\n\nconst App = new Xui();\n\nApp.init(document.body);\n```\n\n3. define an element.\n\n```js\n// index.js\n\nimport { XuiElement, Variable } from 'xuijs';\n\nexport class Ticker extends XuiElement {\n  constructor(el) {\n    super(el);\n\n    this.ticks = new Variable(0);\n    this.state = new Variable(false);\n  }\n\n  getTicks(ticks) {\n    return `${ticks}`;\n  }\n\n  resetTicks() {\n    this.ticks.value = 0;\n  }\n\n  getState(state) {\n    return state ? 'stop' : 'start';\n  }\n\n  switchState() {\n    if (this.state.value) {\n      window.clearInterval(this.ticker);\n    } else {\n      this.ticker = window.setInterval(() =\u003e this.ticks.value++, 1000);\n    }\n\n    this.state.value = !this.state.value;\n  }\n}\n```\n\n4. use the element.\n\n```html\n\u003cbody\u003e\n  \u003cdiv $init mount=\":Ticker\"\u003e\n    \u003cspan $bind:.inner-text=\"ticks@getTicks\"\u003e0\u003c/span\u003e\n    \u003cdiv $init\u003e\n      \u003cbutton $event:click=\"@switchState\" $bind:.inner-text=\"state@getState\"\u003e\n        start\n      \u003c/button\u003e\n      \u003cbutton $event:click=\"@resetTicks\"\u003ereset\u003c/button\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/body\u003e\n```\n\n5. bundle with your favourite bundeler.\n\n# docs\n\nsee [docs/](https://github.com/0xc0Der/xuijs/tree/main/docs 'docs/') folder for more details.\n\n# examples\n\nsee [examples/](https://github.com/0xc0Der/xuijs/tree/main/examples 'examples/') folder for example projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xc0Der%2Fxuijs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xc0Der%2Fxuijs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xc0Der%2Fxuijs/lists"}