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│
└────┘└────────────────────────────────────┘└─────┘
```
# Supported Platforms
- Linux
- MacOS
- Windows
- WebAssembly
| Next |
|--------------------------------------:|
| [Getting Started](getting-started.html) |
@defgroup screen ftxui/screen
Please check the [tutorial](module-screen.html) of the `ftxui/screen` module.
@defgroup dom ftxui/dom
Please check the [tutorial](module-dom.html) of the `ftxui/dom` module.
@defgroup component ftxui/component
Please check the [tutorial](module-component.html) of the `ftxui/component`
module.