Title: UI interface & bindings design · Issue #2 · bombshell-dev/ui · GitHub
Open Graph Title: UI interface & bindings design · Issue #2 · bombshell-dev/ui
X Title: UI interface & bindings design · Issue #2 · bombshell-dev/ui
Description: The UI package should basically behave like a design system - exporting various typescript components which render to the terminal using tty (aka clayterm right now). Let's use this issue to decide the rough structure of the following: W...
Open Graph Description: The UI package should basically behave like a design system - exporting various typescript components which render to the terminal using tty (aka clayterm right now). Let's use this issue to decide...
X Description: The UI package should basically behave like a design system - exporting various typescript components which render to the terminal using tty (aka clayterm right now). Let's use this issue to de...
Opengraph URL: https://github.com/bombshell-dev/ui/issues/2
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"UI interface & bindings design","articleBody":"The UI package should basically behave like a design system - exporting various typescript components which render to the terminal using tty (aka clayterm right now).\n\nLet's use this issue to decide the rough structure of the following:\n\n- What belongs in bindings vs the main package\n- What does the usage look like?\n- What initial components we should export\n\n## Initial components\n\nWe can start with:\n\n- Window (or \"region\")\n- Text\n- Box\n\n### Window / Region\n\nWhen creating a TUI, the root is a region of the terminal (columns & rows). To this, we render components which have been composed in a DOM-like tree.\n\n### Text\n\nRender text to the window.\n\n```ts\ninterface TextProps {\n value: string;\n color: string;\n bgColor: string;\n bold: boolean;\n underline: boolean;\n}\n```\n\n### Box\n\nRender a box in the window which can contain other components.\n\n```ts\ninterface BoxProps {\n width: unknown; // what is this? a number?\n height: unknown; // what is this? a number?\n padding?: {\n top?: number;\n right?: number;\n down?: number;\n left?: number;\n };\n bgColor?: string;\n borderTop?: { width: number; color: string; };\n borderRight?: { width: number; color: string; };\n borderBottom?: { width: number; color: string; };\n borderLeft?: { width: number; color: string; };\n}\n```\n\n- Any other properties we're missing here?\n- What about margin?\n\n## Usage / API\n\nWe need to decide what the right API shape is. Something like this:\n\n```ts\nconst doc = ui.createWindow({\n width: 200,\n height: 100,\n});\n\ndoc.render(new ui.Box(\n {}, // properties of a box\n [ // children of a box\n new ui.Text('Foo')\n ]\n));\n```\n\nThis is just quick pseudo-code. We need to iterate on this together to figure out the right shape.\n\nA few important things to take into account:\n\n- We should be able to pass our own writable stream in (i.e. no hard-coded `process.stdout` anywhere other than the default options)\n- Not all components should have children, so we need to control that per component type\n- Although we will have bindings, many will use this package directly, so this shape matters just as much\n- Initially, we don't need to care about multiple regions\n\n## How bindings work\n\nOnce we have a working UI package, we can create \"bindings\" for these. For example, solid or svelte bindings (aka integrations).\n\nA binding implementation should allow you to use all the base components UI provides but in whatever way the chosen framework/library prefers (e.g. using signals).\n\nThis means every binding implementation should basically export all the same components as the UI package but as wrappers which tie into the integration.\n\n## Open questions\n\n- We haven't yet decided how this root window/region works. Given our focus is TUIs here, we do need some root component to allow people to just drop a tree of components in and it automatically be responsive etc. What should that look like in typescript?\n- What is missing from clayterm/tty that we need in order to deliver these base components? (if anything)\n","author":{"url":"https://github.com/43081j","@type":"Person","name":"43081j"},"datePublished":"2026-06-13T13:48:52Z","url":"https://github.com/bombshell-dev/ui/issues/2"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0cd28eb4-e6ef-7ee5-c1d7-91b5d4c11f47 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBBA:2733CE:19C009F:232647B:6AF9A7BE |
| html-safe-nonce | 408bd699adbdbf4736135663b32bc245dd9ba1d95b48e28a7c240c7b9826b750 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkJBOjI3MzNDRToxOUMwMDlGOjIzMjY0N0I6NkFGOUE3QkUiLCJ2aXNpdG9yX2lkIjoiNzY3OTgwMTIwODEwOTM3NzQ3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e567c378b839f7a106da96a93074c70e5ec08a657c1de379c04a1134a1332957 |
| hovercard-subject-tag | issue:4655705015 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bombshell-dev/ui/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4bce7bb70402007f0f133115fb710c742a7202993d6222aa3a60280792b7a898/bombshell-dev/ui/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4bce7bb70402007f0f133115fb710c742a7202993d6222aa3a60280792b7a898/bombshell-dev/ui/issues/2 |
| og:image:alt | The UI package should basically behave like a design system - exporting various typescript components which render to the terminal using tty (aka clayterm right now). Let's use this issue to decide... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 43081j |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/bombshell-dev/ui git https://github.com/bombshell-dev/ui.git |
| octolytics-dimension-user_id | 169915079 |
| octolytics-dimension-user_login | bombshell-dev |
| octolytics-dimension-repository_id | 1267787446 |
| octolytics-dimension-repository_nwo | bombshell-dev/ui |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1267787446 |
| octolytics-dimension-repository_network_root_nwo | bombshell-dev/ui |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width