doc/introduction.md
@mainpage Introduction @tableofcontents
</img>FTXUI is simple cross-platform C++ library for terminal based user interfaces!
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <iostream>
int main() {
using namespace ftxui;
// Create a simple document with three text elements.
Element document = hbox({
text("left") | border,
text("middle") | border | flex,
text("right") | border,
});
// Create a screen with full width and height fitting the document.
auto screen = Screen::Create(
Dimension::Full(), // Width
Dimension::Fit(document) // Height
);
// Render the document onto the screen.
Render(screen, document);
// Print the screen to the console.
screen.Print();
}
Expected output:
┌────┐┌────────────────────────────────────┐┌─────┐
│left││middle ││right│
└────┘└────────────────────────────────────┘└─────┘
| Next |
|---|
| Getting Started |
@defgroup screen ftxui/screen
Please check the tutorial of the ftxui/screen module.
@defgroup dom ftxui/dom
Please check the tutorial of the ftxui/dom module.
@defgroup component ftxui/component
Please check the tutorial of the ftxui/component
module.