{"id":18609681,"url":"https://github.com/unlight/h-document-element","last_synced_at":"2025-11-02T20:30:27.471Z","repository":{"id":57259921,"uuid":"196086366","full_name":"unlight/h-document-element","owner":"unlight","description":"Create html elements from jsx (tsx) syntax","archived":false,"fork":false,"pushed_at":"2020-02-13T18:23:49.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-27T09:08:52.850Z","etag":null,"topics":["create-element","html-element","html-elements","jsx","jsx-renderer","tsx"],"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/unlight.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-07-09T21:27:41.000Z","updated_at":"2020-02-13T18:23:51.000Z","dependencies_parsed_at":"2022-08-25T01:51:24.864Z","dependency_job_id":null,"html_url":"https://github.com/unlight/h-document-element","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlight%2Fh-document-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlight%2Fh-document-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlight%2Fh-document-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlight%2Fh-document-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unlight","download_url":"https://codeload.github.com/unlight/h-document-element/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239400596,"owners_count":19632049,"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":["create-element","html-element","html-elements","jsx","jsx-renderer","tsx"],"created_at":"2024-11-07T03:06:57.040Z","updated_at":"2025-11-02T20:30:27.426Z","avatar_url":"https://github.com/unlight.png","language":"TypeScript","readme":"# h-document-element\nCreate html elements from jsx/tsx syntax\n\n## Usage\n```json\n// tsconfig.json\n{\n  \"compilerOptions\": {\n    \"jsx\": \"react\",\n    \"jsxFactory\": \"createElement\"\n  }\n}\n```\n\nJSX/TSX code:\n```ts\nimport { createElement } from 'h-document-element';\n\ndocument.body.appendChild(\n  \u003cdiv\u003e\n    \u003cdiv id=\"greet\" /\u003e\n    \u003cbutton onClick={() =\u003e alert('Hi!')}\u003eSay\u003c/button\u003e\n  \u003c/div\u003e\n);\n```\n\nEquivalent plain JavaScript code\n```js\nconst divGreetElement = document.createElement('div');\ndivGreetElement.id = 'greet';\nconst buttonElement = document.createElement('button');\nbuttonElement.onclick = () =\u003e alert('Hi!');\nbuttonElement.append('Say');\nconst divElement = document.createElement('div');\ndivElement.append(divGreetElement, buttonElement);\ndocument.body.appendChild(divElement);\n```\n\n## Browser Support\nOnly modern browsers are supported:\n* Chrome 69\n* Edge 76\n* Firefox 62\n* Opera 56\n* Safari 12\n\nIf you need IE, you need polyfill for:\n* [Object.entries()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill)\n* [ParentNode.append()](https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/append#Polyfill)\n* [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)\n* [Array.flat()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat)\n\n## Similar Projects\n- https://github.com/LeDDGroup/tsx-create-html-element\n- https://github.com/Lusito/tsx-dom\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlight%2Fh-document-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funlight%2Fh-document-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlight%2Fh-document-element/lists"}