{"id":15659176,"url":"https://github.com/marcoroth/stimulus-render","last_synced_at":"2025-05-05T17:21:55.004Z","repository":{"id":98535631,"uuid":"449488502","full_name":"marcoroth/stimulus-render","owner":"marcoroth","description":"[PoC] HTML rendering mechanism for Stimulus Controllers","archived":false,"fork":false,"pushed_at":"2022-09-04T13:33:19.000Z","size":199,"stargazers_count":21,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-04T20:46:35.213Z","etag":null,"topics":["dom","html","javascript","jsx","stimulus","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/marcoroth.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":"2022-01-19T00:08:02.000Z","updated_at":"2024-08-07T23:41:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"a7ab990a-8bc5-46f5-8881-fa27e4edfc46","html_url":"https://github.com/marcoroth/stimulus-render","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"7d8bbff84d4c4210ba1c9f0260e9ec31a879b286"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fstimulus-render","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fstimulus-render/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fstimulus-render/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fstimulus-render/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcoroth","download_url":"https://codeload.github.com/marcoroth/stimulus-render/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252542090,"owners_count":21764909,"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":["dom","html","javascript","jsx","stimulus","typescript"],"created_at":"2024-10-03T13:15:31.083Z","updated_at":"2025-05-05T17:21:54.959Z","avatar_url":"https://github.com/marcoroth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stimulus Render\n\n## Getting Started\n\n```bash\nyarn add stimulus-render\n```\n\n### Counter Example\n\n```html\n\u003cdiv data-controller=\"counter\"\u003e\u003c/div\u003e\n```\n\n\n```js\n// app/javascript/controllers/counter_controller.js\n\nimport { Controller } from '@hotwired/stimulus'\nimport { useRender, h } from 'stimulus-render'\n\n/** @jsx h */\n\nexport default class extends Controller {\n  static values = { counter: 1 }\n\n  connect () {\n    useRender(this)\n  }\n\n  increment () {\n    this.counterValue += 1\n  }\n\n  render () {\n    return (\n      \u003cdiv id=\"counter\"\u003e\n        \u003cbutton data-action=\"click-\u003ecounter#increment\"\u003e\n          Count: {this.counterValue}\n        \u003c/button\u003e\n      \u003c/div\u003e\n    )\n  }\n}\n```\n\n### List/Item Example\n\n\n```html\n\u003cdiv data-controller=\"list\"\u003e\n  \u003cul\u003e\n    \u003cli data-list-target=\"item\" data-value=\"# Title 1\"\u003e\u003c/li\u003e\n    \u003cli data-list-target=\"item\" data-value=\"**Two Bold**\"\u003e\u003c/li\u003e\n    \u003cli data-list-target=\"item\" data-value=\"[Three Link](https://github.com/marcoroth/stimulus-render)\"\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/div\u003e\n```\n\n\n```js\n// app/javascript/controllers/list_controller.js\n\nimport { Controller } from '@hotwired/stimulus'\nimport { useRender, h } from 'stimulus-render'\nimport { processMarkdown } from 'some-markdown-rendering-package'\n\n/** @jsx h */\n\nexport default class extends Controller {\n  static targets = ['item']\n\n  connect () {\n    useRender(this)\n  }\n\n  renderItemTarget(target) {\n    return (\n      \u003cspan\u003e\n        {processMarkdown(target.dataset.value)}\n      \u003c/span\u003e\n    )\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoroth%2Fstimulus-render","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcoroth%2Fstimulus-render","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoroth%2Fstimulus-render/lists"}