mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-11-04 21:48:15 +08:00 
			
		
		
		
	
		
			Some checks are pending
		
		
	
	Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (cl, cl, windows-latest) (push) Waiting to run
				
			Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (clang, clang++, macos-latest) (push) Waiting to run
				
			Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (clang, clang++, ubuntu-latest) (push) Waiting to run
				
			Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (gcc, g++, macos-latest) (push) Waiting to run
				
			Build / Bazel, ${{ matrix.cxx }}, ${{ matrix.os }} (gcc, g++, ubuntu-latest) (push) Waiting to run
				
			Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (cl, Windows MSVC, windows-latest) (push) Waiting to run
				
			Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (gcc, Linux GCC, ubuntu-latest) (push) Waiting to run
				
			Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, Linux Clang, ubuntu-latest) (push) Waiting to run
				
			Build / CMake, ${{ matrix.compiler }}, ${{ matrix.os }} (llvm, llvm-cov gcov, MacOS clang, macos-latest) (push) Waiting to run
				
			Documentation / documentation (push) Waiting to run
				
			
		
			
				
	
	
		
			63 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
@page getting-started Getting Started
 | 
						|
@tableofcontents
 | 
						|
 | 
						|

 | 
						|
 | 
						|
# Install FTXUI
 | 
						|
 | 
						|
To set up FTXUI in your project, follow the [installation guide](installation.html), which provides instructions for multiple build systems and package managers.
 | 
						|
 | 
						|
# Minimal Example
 | 
						|
 | 
						|
Save the following code as `main.cpp`:
 | 
						|
 | 
						|
```cpp
 | 
						|
#include <ftxui/dom/elements.hpp>
 | 
						|
#include <ftxui/screen/screen.hpp>
 | 
						|
#include <iostream>
 | 
						|
 | 
						|
int main() {
 | 
						|
  using namespace ftxui;
 | 
						|
 | 
						|
  Element document = hbox({
 | 
						|
    text("left")   | border,
 | 
						|
    text("middle") | border | flex,
 | 
						|
    text("right")  | border,
 | 
						|
  });
 | 
						|
 | 
						|
  auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
 | 
						|
  Render(screen, document);
 | 
						|
  screen.Print();
 | 
						|
}
 | 
						|
```
 | 
						|
 | 
						|
Build and run it using your preferred build system.  
 | 
						|
If unsure, start with one of the methods described in the [installation page](installation.html).
 | 
						|
 | 
						|
Expected output:
 | 
						|
 | 
						|
```
 | 
						|
┌────┐┌────────────────────────────────────┐┌─────┐
 | 
						|
│left││middle                              ││right│
 | 
						|
└────┘└────────────────────────────────────┘└─────┘
 | 
						|
```
 | 
						|
 | 
						|
# Starter Template
 | 
						|
 | 
						|
For a complete working project, clone the official starter repository:
 | 
						|
 | 
						|
```bash
 | 
						|
git clone https://github.com/ArthurSonzogni/ftxui-starter
 | 
						|
```
 | 
						|
 | 
						|
Follow the build instructions in the `README.md` of that repository.
 | 
						|
 | 
						|
<div class="section_buttons">
 | 
						|
 
 | 
						|
| Previous                          | Next                    |
 | 
						|
|:----------------------------------|------------------------:|
 | 
						|
| [Introduction](index.html) | [Modules](modules.html) |
 | 
						|
 | 
						|
 
 | 
						|
</div>
 |