{"id":18534789,"url":"https://github.com/atomicojs/lit-html","last_synced_at":"2025-07-09T20:32:33.635Z","repository":{"id":61243582,"uuid":"504398256","full_name":"atomicojs/lit-html","owner":"atomicojs","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-17T13:20:21.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-27T00:38:15.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atomicojs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-17T04:54:11.000Z","updated_at":"2022-06-17T04:58:00.000Z","dependencies_parsed_at":"2023-01-20T07:15:49.869Z","dependency_job_id":null,"html_url":"https://github.com/atomicojs/lit-html","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/atomicojs/lit-html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicojs%2Flit-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicojs%2Flit-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicojs%2Flit-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicojs%2Flit-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomicojs","download_url":"https://codeload.github.com/atomicojs/lit-html/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicojs%2Flit-html/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262951533,"owners_count":23389879,"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":[],"created_at":"2024-11-06T19:16:57.189Z","updated_at":"2025-07-09T20:32:33.578Z","avatar_url":"https://github.com/atomicojs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @atomico/lit-html\r\n\r\n[![Discord](https://raw.githubusercontent.com/atomicojs/atomico/brand/link-to-discord.svg)](https://discord.gg/7z3rNhmkNE) [![Twitter](https://raw.githubusercontent.com/atomicojs/atomico/brand/link-to-twitter.svg)](https://twitter.com/atomicojs)\r\n\r\n`@atomico/lit-html` will allow you to use lit-html within Atomico, example:\r\n\r\n```js\r\nimport { c } from \"atomico\";\r\nimport { html } from \"@atomico/lit-html\";\r\n\r\nfunction component() {\r\n    return html`\u003ch1\u003eAtomico + lit-html\u003c/h1\u003e`;\r\n}\r\n```\r\n\r\nThe first html return must always come from the `@atomico/lit-html` model, since atomico adds the render method to this function, which allows atomico to render any library.\r\n\r\n## Objectives.\r\n\r\n1. Support lit-html as an optional renderer for developers who are comfortable with lit-html.\r\n2. Give declarative support to the use of the shadowDom.\r\n3. Support references, to share hooks between Atomico, lit-html, react and react.\r\n\r\n## shadowDom\r\n\r\n```js\r\nimport { c } from \"atomico\";\r\nimport { html } from \"@atomico/lit-html\";\r\n\r\nfunction component({ message }: Props\u003ctypeof component\u003e) {\r\n    html.shadowDom = true;\r\n    return html`\u003ch1\u003eWelcome to ${message}!\u003c/h1\u003e`;\r\n}\r\n\r\ncomponent.props = {\r\n    message: { type: String, value: \"Atomico\" },\r\n};\r\n\r\ncustomElements.define(\"my-component\", c(component));\r\n```\r\n\r\n## useRender\r\n\r\nHomologous hook of useRender from [@atomico/hooks/use-render](https://atomico.gitbook.io/doc/atomico/atomico-hooks/use-render).\r\n\r\n```js\r\nimport { useRender } from \"@atomico/lit-html\";\r\n\r\nfunction component() {\r\n    useRender(() =\u003e html`\u003cinput type=\"text\" /\u003e`);\r\n}\r\n```\r\n\r\n## ref\r\n\r\nAllows the use of Atomico references within lit-html.\r\n\r\n```js\r\nimport { useRef } from \"atomico\";\r\nimport { ref } from \"@atomico/lit-html\";\r\n\r\nfunction component() {\r\n    const refInput = useRef();\r\n    return html`\u003cinput type=\"text\" ${ref(refInput)} /\u003e`;\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicojs%2Flit-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomicojs%2Flit-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicojs%2Flit-html/lists"}