https://github.com/hanilr/variation-ui
Single-header terminal user interface library. Written in ansi-c
https://github.com/hanilr/variation-ui
ansi-c c single-header single-header-lib terminal-user-interace tui ui user-interface
Last synced: 2 months ago
JSON representation
Single-header terminal user interface library. Written in ansi-c
- Host: GitHub
- URL: https://github.com/hanilr/variation-ui
- Owner: hanilr
- License: mit
- Created: 2022-04-08T18:03:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-28T09:57:20.000Z (3 months ago)
- Last Synced: 2025-02-28T16:46:27.185Z (3 months ago)
- Topics: ansi-c, c, single-header, single-header-lib, terminal-user-interace, tui, ui, user-interface
- Language: C
- Homepage:
- Size: 290 KB
- Stars: 21
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#  VARIATION UI 
Variation-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).
>  If you don't need widget, then there's a lite version of this library. It's also optimized and simplified and contains no widgets. [Variation Lite UI](https://github.com/hanilr/variation-lite-ui)
###  Dependencies:
* ` gcc ` _> Gnu Compiler Collection_
* ` make ` _> Gnu Make_> You can install with package managers for linux.
##  Important Note 
You need to define ` #define VN_UI_IMPLEMENTATION ` before ` #include "vn_ui.h" `
```c
#define VN_UI_IMPLEMENTATION
#include "vn_ui.h"
```##  Example 
```c
#include#define VN_UI_IMPLEMENTATION
#define VN_COLOR
#define VN_WIDGET
#include "vn_ui.h"int main()
{
struct vn_init vn;
vn.width = 60;
vn.height = 5;
vn.pos_x = 2;
vn.pos_y = 2;struct vnc_color white;
struct vnc_color black;
white.is_fore = 0;
white.color = vn_hex_color("e9e9e9", white.is_fore);
black.is_fore = 1;
black.color = vn_rgb_color(22, 22, 22, black.is_fore);
char* msg = "This is the example. If you had a trouble please leave an issue to https://github.com/hanilr/variation/issues have fun!";
vn_clear();
vn_label(vn.pos_x, vn.pos_y, vn.width, vn.height, black.color, white.color, text_italic, msg);
vn_end(vn);return 0;
}
```#  Compiling as shared-library or Using as default 
> Show make list `make` or `make run`
```
make run
``` You can compile as shared-library and develope os specific projects. 
 How should I compile? 
```
make compile
```
> Unix shared-library (.so)
>
> If you want to delete this file you can use ` make clean ` What if I want to use as default? 
```
make install
```
> If you only want to download library with terminal then use curl tool
```sh
curl -fLo /usr/include/vn/vn_ui.h --create-dirs https://raw.githubusercontent.com/hanilr/variation-ui/master/vn_ui.h
```
> If you use curl tool then you need to compile with sudo.
>
> You can find in ` /usr/include/vn/ `
>
> If you want to uninstall you can use ` make uninstall `### [](doc/markdown/wiki.md) :  You can take a look to wiki page if you want learn more! 
#### Check Other Variation Libraries
* [Variation Lite: User Interface](https://github.com/hanilr/variation-lite-ui) - A terminal user interface in Ansi-C with optimize code and no widgets.
* [Variation: Binary](https://github.com/hanilr/variation-bin) - A binary analysis library in Ansi-C.