{"id":13568056,"url":"https://github.com/hanilr/variation-ui","last_synced_at":"2025-07-24T01:04:37.376Z","repository":{"id":55429251,"uuid":"479491333","full_name":"hanilr/variation-ui","owner":"hanilr","description":"Single-header terminal user interface library. Written in ansi-c","archived":false,"fork":false,"pushed_at":"2025-02-28T09:57:20.000Z","size":297,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-04T04:35:06.713Z","etag":null,"topics":["ansi-c","c","single-header","single-header-lib","terminal-user-interace","tui","ui","user-interface"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hanilr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-04-08T18:03:25.000Z","updated_at":"2025-03-06T08:26:49.000Z","dependencies_parsed_at":"2025-04-04T04:40:45.469Z","dependency_job_id":null,"html_url":"https://github.com/hanilr/variation-ui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hanilr/variation-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanilr%2Fvariation-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanilr%2Fvariation-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanilr%2Fvariation-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanilr%2Fvariation-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanilr","download_url":"https://codeload.github.com/hanilr/variation-ui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanilr%2Fvariation-ui/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266775365,"owners_count":23982273,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["ansi-c","c","single-header","single-header-lib","terminal-user-interace","tui","ui","user-interface"],"created_at":"2024-08-01T14:00:19.436Z","updated_at":"2025-07-24T01:04:37.367Z","avatar_url":"https://github.com/hanilr.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"\u003c!-- ![vn](img/vn.png) --\u003e\n\u003c!-- ![vn_info](img/vn_info.png) --\u003e\n\u003c!-- ![vn_warn](img/vn_warn.png) --\u003e\n\u003c!-- ![vn_example](img/vn_example.png) --\u003e\n\u003c!-- ![vn_wiki](img/vn_wiki.png) --\u003e\n\n# ![vn](img/vn.png) VARIATION UI ![vn](img/vn.png)\n\nVariation-ui is single-header terminal user interface library. Written in ansi-c. Simple to use, easy to learn and has small codebase. Also updatable thanks to MIT license (Look [license](#license) if you want to know more).\n\n### ![vn_info](img/vn_info.png) Dependencies:\n\n* ` gcc ` _\u003e Gnu Compiler Collection_\n* ` make ` _\u003e Gnu Make_\n\n## ![vn_warn](img/vn_warn.png) Important Note ![vn_warn](img/vn_warn.png)\n\nYou need to define ` #define VN_UI_IMPLEMENTATION ` before ` #include \"vn_ui.h\" `\n```c\n#define VN_UI_IMPLEMENTATION\n#include \"vn_ui.h\"\n```\n\n## ![vn_example](img/vn_example.png) Example ![vn_example](img/vn_example.png)\n\n```c\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n#include \u003cstring.h\u003e\n\n#define VN_UI_IMPLEMENTATION // Base features\n#define VN_WIDGET // Widget features\n#include \"vn_ui.h\"\n\nint main()\n{\n  /* Color declaring */\n  char* color_fg_red = vn_color(\"#e93737\", 'f');\n  char* color_bg_blue = vn_color(\"#3737e9\", 'b');\n\n  /* Text attribute */\n  VN_UI_TEXT vnt;\n  strcpy(vnt.color_fg, color_fg_red);\n  strcpy(vnt.color_bg, color_bg_blue);\n  strcpy(vnt.text_style, vn_text_bold);\n\n  /* Widget values */\n  VN_UI_WIDGET vnw;\n  vnw.pos_x = 2;\n  vnw.pos_y = 2;\n  vnw.width = 20;\n  vnw.height = 10;\n\n  /* UI Section */\n  vn_bg(' ', vnt, vnw); // Background\n  vn_gotoxy((vnw.pos_x + vnw.width) / 2, (vnw.pos_y + vnw.height) / 2); // Go to middle\n  vn_print(\"This is the example.\", 'y', vnt.color_fg, vnt.color_bg, vnt.text_style); // Colourful printing\n  vn_gotoxy((vnw.pos_x + vnw.width), (vnw.pos_y + vnw.height)); // Go to end\n\n  // Free after use 'vn_color'\n  free(color_fg_red);\n  free(color_bg_blue);\n\n  return 0;\n}\n```\n\n# ![vn](img/vn.png) Compiling as shared-library or Using as default ![vn](img/vn.png)\n\n\u003e Show make list `make` or `make run`\n```\n  make run\n```\n\n![vn_warn](img/vn_warn.png) You can compile as shared-library and develope os specific projects. ![vn_warn](img/vn_warn.png)\n\n![vn_example](img/vn_example.png) How should I compile? ![vn_example](img/vn_example.png)\n```\n  make compile\n```\n\u003e Unix shared-library (.so)\n\u003e\n\u003e Windows shared-library (.dll)\n\u003e\n\u003e If you want to delete this file you can use ` make clean `\n\n![vn_example](img/vn_example.png) What if I want to use as default? ![vn_example](img/vn_example.png)\n```\n  make install\n```\n\n### [![vn_wiki](img/vn_wiki.png)](doc/markdown/wiki.md) : ![vn_warn](img/vn_warn.png) You can take a look to wiki page if you want learn more! ![vn_warn](img/vn_warn.png)\n\n#### Check Other Variation Libraries\n\n* [Variation: Binary](https://github.com/hanilr/variation-bin) - A binary analysis library in Ansi-C.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanilr%2Fvariation-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanilr%2Fvariation-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanilr%2Fvariation-ui/lists"}