{"id":34656679,"url":"https://github.com/miunau/sveltty","last_synced_at":"2025-12-24T18:09:24.327Z","repository":{"id":326835204,"uuid":"1104543192","full_name":"miunau/sveltty","owner":"miunau","description":"Render and interact with Svelte components in the terminal","archived":false,"fork":false,"pushed_at":"2025-11-30T11:39:53.000Z","size":300,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-15T05:30:58.857Z","etag":null,"topics":["css","html","javascript","svelte","terminal","tui"],"latest_commit_sha":null,"homepage":"","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/miunau.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-26T11:00:00.000Z","updated_at":"2025-12-06T04:50:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/miunau/sveltty","commit_stats":null,"previous_names":["miunau/sveltty"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/miunau/sveltty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miunau%2Fsveltty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miunau%2Fsveltty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miunau%2Fsveltty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miunau%2Fsveltty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miunau","download_url":"https://codeload.github.com/miunau/sveltty/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miunau%2Fsveltty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28005981,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"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":["css","html","javascript","svelte","terminal","tui"],"created_at":"2025-12-24T18:05:32.248Z","updated_at":"2025-12-24T18:09:24.321Z","avatar_url":"https://github.com/miunau.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SvelTTY\n\nSvelTTY provides a runtime that allows you to render and interact with Svelte apps in the terminal.\n\n\u003cimg width=\"1752\" height=\"1381\" alt=\"Screenshot 2025-11-30 at 10 08 00\" src=\"https://github.com/user-attachments/assets/12aaa83e-5d83-4ef0-a6b4-14485efe5446\" /\u003e\n\nPains are taken to make it easy to use and translate mindset-wise from the web to a TUI. There are no special `\u003cBox\u003e` or `\u003cText\u003e` components; just use regular HTML, CSS and JavaScript, including Svelte runes.\n\n- Supports most common HTML elements and attributes (typography, forms, lists, tables, details, progress, etc.) and their CSS properties.\n- Full styling of everything using common CSS with a few novel properties for terminal-specific behavior.\n- Full 24-bit color support. Renders CSS gradients, `\u003cimg\u003e` elements in supported terminals. Colors, alignment/layout, padding/margin, backgrounds, borders, states, gradients et cetera, including calc() and custom CSS variables, work out of the box as you would (mostly) expect.\n- Supports JavaScript and Svelte 5 reactivity (`$state`, `$effect`, `$derived`, etc.).\n- Popover + anchor positioning API support.\n\n## Installation\n\n```bash\nnpm install sveltty svelte\n```\n\nSvelte is a peer dependency, so you need to install it as well.\n\n## Quick Start\n\n```ts\nimport { runFile } from 'sveltty';\n\nawait runFile('./App.svelte', {\n    baseDir: import.meta.dirname,\n});\n```\n\nor with runner:\n\n```bash\nnode --import sveltty/register app.js\n```\n\n```ts\nimport App from './App.svelte';\nimport { runComponent } from 'sveltty';\n\nrunComponent(App);\n```\n\nSee the [example](./example) for a complete example.\n\n### First things to know\n\n- Everything is a flex container; the only `display` values that are supported are `flex` and `none`, with `flex` being the default.\n- The base CSS styling for all elements is overrideable. SvelTTY provides a [default \"user agent stylesheet\"](./src/runtime/style/defaults.ts) that defines the base appearance for all elements in the terminal environment, however, everything is customizable.\n- I use `ch` as the CSS sizing unit, but any non-percentage unit is treated the same, so feel free to use `px` etc.\n- You can use `\u003cimg\u003e` elements to render images in supported terminals. Be sure to set a width and height.\n- No CSS animation support- for ease of rendering + performance, the screen drawing is synchronous and not a frame-based renderer. If necessary you can do JS based animations eg. with setTimeout().\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiunau%2Fsveltty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiunau%2Fsveltty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiunau%2Fsveltty/lists"}