{"id":17657976,"url":"https://github.com/3rd/go-futui","last_synced_at":"2025-03-30T10:13:56.343Z","repository":{"id":219515527,"uuid":"738296870","full_name":"3rd/go-futui","owner":"3rd","description":"Futuristic TUI library for Go.","archived":false,"fork":false,"pushed_at":"2024-07-20T13:17:24.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T12:12:14.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/3rd.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}},"created_at":"2024-01-02T22:46:05.000Z","updated_at":"2024-07-20T13:17:28.000Z","dependencies_parsed_at":"2024-01-28T02:29:25.830Z","dependency_job_id":"3f9d0492-49fb-44c3-87ee-9e1358af2631","html_url":"https://github.com/3rd/go-futui","commit_stats":null,"previous_names":["3rd/go-futui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3rd%2Fgo-futui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3rd%2Fgo-futui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3rd%2Fgo-futui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3rd%2Fgo-futui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3rd","download_url":"https://codeload.github.com/3rd/go-futui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301996,"owners_count":20755514,"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-10-23T14:43:50.297Z","updated_at":"2025-03-30T10:13:56.298Z","avatar_url":"https://github.com/3rd.png","language":"Go","readme":"# go-futui: Futuristic TUI library for Go.\n\n\u003e [!IMPORTANT]\n\u003e Very much WIP, you probably don't want to build stuff with this yet.\n\n## Installation\n\n```sh\ngo get github.com/3rd/go-futui\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"strconv\"\n\t\"time\"\n\n\tui \"github.com/3rd/go-futui\"\n\t\"github.com/gdamore/tcell/v2\"\n)\n\n// basic component\ntype Counter struct {\n\tui.Component\n\tvalue int\n}\n\nfunc (c *Counter) Render() ui.Buffer {\n\tb := ui.Buffer{}\n\tb.Text(0, 0, \"Count: \"+strconv.Itoa(c.value), ui.Style{\n\t\tBackground: \"#ff0000\",\n\t\tForeground: \"#000000\",\n\t\tBold:       true,\n\t\tItalic:     true,\n\t\tUnderline:  true,\n\t})\n\treturn b\n}\n\n// app with state\ntype State struct {\n\tcounter int\n}\n\ntype MyApp struct {\n\tui.App\n\tstate State\n}\n\nfunc (app *MyApp) Setup() {\n\tticker := time.NewTicker(time.Millisecond * 16)\n\tgo func() {\n\t\tfor range ticker.C {\n\t\t\tapp.state.counter++\n\t\t\tapp.Update()\n\t\t}\n\t}()\n}\n\nfunc (app *MyApp) Render() ui.Buffer {\n\tb := ui.Buffer{}\n\tb.Resize(app.Width(), app.Height())\n\tb.FillStyle(ui.Style{\n\t\tBackground: \"#00ff00\",\n\t\tForeground: \"#000000\",\n\t})\n\tb.Text(0, 0, \"Hello World!\", ui.Style{Foreground: \"#220ee0\"})\n\tb.DrawComponent(0, 1, \u0026Counter{value: app.state.counter})\n\treturn b\n}\n\nfunc (app *MyApp) OnKeypress(ev tcell.EventKey) {\n\tswitch ev.Key() {\n\tcase tcell.KeyCtrlC:\n\t\tapp.Quit()\n\t}\n\tapp.state.counter++\n\tapp.Update()\n}\n\nfunc (app *MyApp) OnResize() {\n\tapp.Update()\n}\n\nfunc main() {\n\tapp := MyApp{}\n\tapp.Run(\u0026app)\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3rd%2Fgo-futui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3rd%2Fgo-futui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3rd%2Fgo-futui/lists"}