Vextr is a flexible widget-based terminal UI framework for modern C++.
- Cross-platform: Windows and Unix terminals supported
- Flexible layout system: stack, grid, absolute positioning
- Rich styling: RGB colors, bold/underline, padding/margin
- Common widgets: labels, buttons, inputs, scroll views
- Simple API for building complex UIs
- Flexibility oriented
- Events
include(FetchContent)
FetchContent_Declare(
vextr
GIT_REPOSITORY https://github.com/Oltsu-code/Vextr.git
GIT_TAG main
)
FetchContent_MakeAvailable(vextr)
target_link_libraries(my_app PRIVATE vextr)-
Include the header:
#include "vextr.h"
-
Create a root Container:
auto root = std::make_shared<vextr::core::Container>( std::make_shared<vextr::core::StackLayout>(vextr::core::Axis::Vertical, 1));
-
Create a Label widget:
auto label = std::make_shared<vextr::widgets::Label>("Hello, Vextr!");
-
create a Style for the Label and apply it:
vextr::core::Style style = { .fg = {54, 9, 217}, .bold = true }; label->set_style(style); -
Add the label to the root container:
root->add_child(label); -
Create the application, set the root container, and run:
vextr::App app; app.setRoot(root); app.run();
-
Clone the repository:
git clone https://github.com/Oltsu-code/Vextr.git cd Vextr -
Build with CMake:
mkdir build cd build cmake .. cmake --build .
-
Have fun!
You can find the online documentation here.
All guides should also be available in the docs/content/ folder.
The code also has doxygen comments.
This repository uses Moxygen to generate the API reference documentation from Doxygen XML.
Note: The documentation is currently a work in progress.
- Install Moxygen
npm install -g moxygen- Install dependencies
cd docs/site
npm instll- Generate the API References and format the content for astro
npm run generate- Start the development server
npm run devor build
npm run buildCheck the currently planned roadmap here.
Contributions are welcome! Please read CONTRIBUTING.md for details.
Mozilla Public License Version 2.0. See LICENSE for details.