{"id":23763683,"url":"https://github.com/tomashubelbauer/paper","last_synced_at":"2026-05-01T16:33:58.310Z","repository":{"id":107986219,"uuid":"320920645","full_name":"TomasHubelbauer/paper","owner":"TomasHubelbauer","description":"JavaScript UI library","archived":false,"fork":false,"pushed_at":"2022-04-14T21:05:00.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-01T16:40:04.592Z","etag":null,"topics":["framework","javascript","library","paper","ui","ux","wc","web-components"],"latest_commit_sha":null,"homepage":"https://tomashubelbauer.github.io/paper","language":"JavaScript","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/TomasHubelbauer.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-12T20:45:32.000Z","updated_at":"2022-04-16T14:18:25.000Z","dependencies_parsed_at":"2023-05-15T00:15:26.185Z","dependency_job_id":null,"html_url":"https://github.com/TomasHubelbauer/paper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TomasHubelbauer/paper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fpaper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fpaper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fpaper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fpaper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomasHubelbauer","download_url":"https://codeload.github.com/TomasHubelbauer/paper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fpaper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32505106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","javascript","library","paper","ui","ux","wc","web-components"],"created_at":"2024-12-31T22:13:17.616Z","updated_at":"2026-05-01T16:33:58.298Z","avatar_url":"https://github.com/TomasHubelbauer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Paper\n\nPaper is a JavaScript UI library which is usable as an ESM module and has no\ndependencies.\n\n## Installation\n\n### `script` Tag\n\n```html\n\u003cscript src=\"https://tomashubelbauer.github.io/paper/index.js\" type=\"module\"\u003e\u003c/script\u003e\n```\n\n### Git Submodule\n\n```bash\ngit submodule add https://github.com/tomashubelbauer/paper\n```\n\n## Usage\n\n`HelloWorld.js`\n```js\nimport { Component, h1, div, ... } from './paper/index.js';\n\n// Note that the component class must inherit from Component directly\nexport default class HelloWorld extends Component {\n  // This constructor must be present for Paper to be able to define the WC\n  // This web component will be defined with tag `paper-hello-world`\n  constructor() {\n    super(HelloWorld);\n  }\n\n  // This method will comprise the component's closed shadow DOM content\n  // A `HelloWorld.css` stylesheet will be imported (and effectively scoped)\n  // A wrapper `div` element surrounds the component with ID equal to its name\n  async *render() {\n    yield h1('Hello, world!');\n    const loaderDiv = div('Loading data…');\n    yield loaderDiv;\n\n    const data = await fetch('/api/data').then(response =\u003e response.json());\n    loaderDiv.remove();\n    for (const item of data.items) {\n      yield div('Item: ', JSON.stringify(item));\n    }\n\n    if (data.more === 0) {\n      return '(no more items)';\n    }\n\n    yield `There are ${data.more} more items!`;\n  }\n}\n```\n\n`HelloWorld.css`\n\nThis file must exist, even if empty. Paper will import it to the closed shadow\nDOM.\n\n`index.js`\n```js\ndocument.body.append(new HelloWorld());\n```\n\n## Purpose\n\nI built Paper accidentally, by finding various tricks and hacks to make the UI\ncode in my personal pure-JS, no-dependencies project a little less tedious to\nwrite. At some point it started making sense to pull it out and use it as a Git\nsubmodule and import it as an ESM module.\n\n## Limitations\n\nThe component class must inherit from `Component` directly. This is because of\nsome trickery used to determine if the class name matches the file name. If you\ndo not want this feature, fork Paper and remove this restriction.\n\n## To-Do\n\n### Split off `Component.js` into a new `paper-wc` repository\n\nPaper should be usable without it and essentially implement the ideas I have\nbeen contemplating in my `acter` and `fragment` repositories. By pulling this\nweb component helper class out, I'll be able to add non-web-components based\ndemos and delete the `acter` and `fragment` repositories making Paper my final\nword on a build-system-less UI framework.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomashubelbauer%2Fpaper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomashubelbauer%2Fpaper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomashubelbauer%2Fpaper/lists"}