{"id":13392773,"url":"https://github.com/tboox/ltui","last_synced_at":"2025-05-16T17:09:04.291Z","repository":{"id":41293811,"uuid":"159041314","full_name":"tboox/ltui","owner":"tboox","description":" 🍖 A cross-platform terminal ui library based on Lua","archived":false,"fork":false,"pushed_at":"2024-08-07T15:17:57.000Z","size":475,"stargazers_count":838,"open_issues_count":5,"forks_count":50,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-12T15:58:58.405Z","etag":null,"topics":["curses","lua","terminal","tui","ui","xmake"],"latest_commit_sha":null,"homepage":"https://tboox.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tboox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-11-25T14:40:10.000Z","updated_at":"2025-04-07T20:15:37.000Z","dependencies_parsed_at":"2024-01-13T15:38:48.302Z","dependency_job_id":"b18e52d3-abc3-4eaa-acc8-1678817fa23b","html_url":"https://github.com/tboox/ltui","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Fltui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Fltui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Fltui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboox%2Fltui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tboox","download_url":"https://codeload.github.com/tboox/ltui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254573589,"owners_count":22093731,"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":["curses","lua","terminal","tui","ui","xmake"],"created_at":"2024-07-30T17:00:36.937Z","updated_at":"2025-05-16T17:09:04.230Z","avatar_url":"https://github.com/tboox.png","language":"C","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eLTUI\u003c/h1\u003e\n\n  \u003cdiv\u003e\n    \u003ca href=\"https://github.com/tboox/ltui/actions?query=workflow%3Abuild\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/tboox/ltui/main.yml?branch=master\u0026style=flat-square\" alt=\"github-ci\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/tboox/ltui/releases\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/release/tboox/ltui.svg?style=flat-square\" alt=\"Github All Releases\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://luarocks.org/modules/waruqi/ltui\"\u003e\n      \u003cimg src=\"https://img.shields.io/luarocks/v/waruqi/ltui.svg?style=flat-square\" alt=\"Luarocks\" /\u003e\n    \u003c/a\u003e\n  \u003c/div\u003e\n  \u003cdiv\u003e\n    \u003ca href=\"https://github.com/tboox/ltui/blob/master/LICENSE.md\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/tboox/ltui.svg?colorB=f48041\u0026style=flat-square\" alt=\"license\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.reddit.com/r/tboox/\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/chat-on%20reddit-ff3f34.svg?style=flat-square\" alt=\"Reddit\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://gitter.im/tboox/tboox?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\u003e\n      \u003cimg src=\"https://img.shields.io/gitter/room/tboox/tboox.svg?style=flat-square\u0026colorB=96c312\" alt=\"Gitter\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://t.me/tbooxorg\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/chat-on%20telegram-blue.svg?style=flat-square\" alt=\"Telegram\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://jq.qq.com/?_wv=1027\u0026k=5hpwWFv\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/chat-on%20QQ-ff69b4.svg?style=flat-square\" alt=\"QQ\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://tboox.org/donation/\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/donate-us-orange.svg?style=flat-square\" alt=\"Donate\" /\u003e\n    \u003c/a\u003e\n    \u003c/div\u003e\n  \u003cp\u003eA cross-platform terminal ui library based on Lua\u003c/p\u003e\n\u003c/div\u003e\n\n## Introduction ([中文](/README_zh.md))\n\nLTUI is a cross-platform terminal ui library based on Lua.\n\nThis framework originated from the requirements of graphical menu configuration in [xmake](https://github.com/xmake-io/xmake).\nSimilar to the linux kernel's menuconf to configure the compilation parameters, so using curses and lua to implement a cross-platform character terminal ui library.\n\nRefer to kconfig-frontends for style rendering. Of course, users can customize different ui styles.\n\n\u003cimg src=\"https://tboox.org/static/img/ltui/choicebox.png\" width=\"70%\" /\u003e\n\n## Installation\n\n```console\n$ luarocks install ltui\n```\n\n## Build\n\nWe need install the cross-platform build utility [xmake](https://github.com/xmake-io/xmake) first.\n\n```console\n$ xmake\n```\n\n## Run tests\n\nWe need install [lua](https://www.lua.org/) or [luajit](http://luajit.org/) to run tests first.\n\n```console\n$ xmake run test dialog\n$ xmake run test window\n$ xmake run test desktop\n$ xmake run test inputdialog\n$ xmake run test mconfdialog\n```\n\nOr\n\n```console\n$ lua tests/dialog.lua\n$ lua tests/window.lua\n$ lua tests/desktop.lua\n$ lua tests/inputdialog.lua\n$ lua tests/mconfdialog.lua\n```\n\nOr\n\n```console\n$ luajit tests/dialog.lua\n$ luajit tests/window.lua\n$ luajit tests/desktop.lua\n$ luajit tests/inputdialog.lua\n$ luajit tests/mconfdialog.lua\n```\n\n## Examples\n\n#### Application\n\n```lua\nlocal ltui        = require(\"ltui\")\nlocal application = ltui.application\nlocal event       = ltui.event\nlocal rect        = ltui.rect\nlocal window      = ltui.window\nlocal demo        = application()\n\nfunction demo:init()\n    application.init(self, \"demo\")\n    self:background_set(\"blue\")\n    self:insert(window:new(\"window.main\", rect {1, 1, self:width() - 1, self:height() - 1}, \"main window\", true))\nend\n\ndemo:run()\n```\n\n#### Label\n\n```lua\nlocal lab = label:new(\"title\", rect {0, 0, 12, 1}, \"hello ltui!\"):textattr_set(\"white\")\n```\n\n#### Button\n\n```lua\nlocal btn = button:new(\"yes\", rect {0, 1, 7, 2}, \"\u003c Yes \u003e\"):textattr_set(\"white\")\n```\n\n#### Input dialog\n\n```lua\nfunction demo:init()\n    -- ...\n\n    local dialog_input = inputdialog:new(\"dialog.input\", rect {0, 0, 50, 8})\n    dialog_input:text():text_set(\"please input text:\")\n    dialog_input:button_add(\"no\", \"\u003c No \u003e\", function (v) dialog_input:quit() end)\n    dialog_input:button_add(\"yes\", \"\u003c Yes \u003e\", function (v) dialog_input:quit() end)\n    self:insert(dialog_input, {centerx = true, centery = true})\nend\n```\n\n## Components\n\n| views     | dialogs      | others      |\n| -------   | ------       | ------      |\n| view      | dialog       | event       |\n| panel     | boxdialog    | action      |\n| label     | textdialog   | canvas      |\n| button    | inputdialog  | curses      |\n| border    | mconfdialog  | program     |\n| window    | choicedialog | application |\n| menubar   |              | point       |\n| menuconf  |              | rect        |\n| textedit  |              | object      |\n| textarea  |              |             |\n| statusbar |              |             |\n| choicebox |              |             |\n| desktop   |              |             |\n\n\n## Snapshot\n\n#### Menu configuration\n\n\u003cimg src=\"https://tboox.org/static/img/ltui/menuconf.png\" width=\"70%\" /\u003e\n\n#### Input dialog\n\n\u003cimg src=\"https://tboox.org/static/img/ltui/inputdialog.png\" width=\"70%\" /\u003e\n\n#### Text area\n\n\u003cimg src=\"https://tboox.org/static/img/ltui/textarea.png\" width=\"70%\" /\u003e\n\n#### Windows\n\n\u003cimg src=\"https://tboox.org/static/img/ltui/windows.png\" width=\"70%\" /\u003e\n\n#### Termux\n\n\u003cimg src=\"https://tboox.org/static/img/ltui/termux.jpeg\" width=\"40%\" /\u003e\n\n\nIf you want to known more, please refer to:\n\n* [HomePage](https://tboox.org)\n* [Github](https://github.com/tboox/ltui)\n* [Gitee](https://gitee.com/tboox/ltui)\n\n## Contacts\n\n* Email：[waruqi@gmail.com](mailto:waruqi@gmail.com)\n* Homepage：[tboox.org](https://tboox.org)\n* Community：[/r/tboox on reddit](https://www.reddit.com/r/tboox/)\n* ChatRoom：[Char on telegram](https://t.me/tbooxorg), [Chat on gitter](https://gitter.im/tboox/tboox?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n* Source Code：[Github](https://github.com/tboox/ltui), [Gitee](https://gitee.com/tboox/ltui)\n\n","funding_links":[],"categories":["Projects","C","Resources"],"sub_categories":["[CLI](https://luarocks.org/labels/commandline)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftboox%2Fltui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftboox%2Fltui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftboox%2Fltui/lists"}