17 "FTXUI: A powerful library for building user interfaces.\n"
18 "Enjoy a rich set of components and a declarative style.\n"
19 "Create beautiful and responsive UIs with minimal effort.\n"
20 "Join the community and experience the power of FTXUI.");
24 auto screen = App::TerminalOutput();
27 Button(
"Quit", screen.ExitLoopClosure(), ButtonOption::Animated());
29 int selection_change_counter = 0;
30 std::string selection_content =
"";
31 screen.SelectionChange([&] {
32 selection_change_counter++;
33 selection_content = screen.GetSelection();
39 text(
"Select changed: " + std::to_string(selection_change_counter) +
41 text(
"Currently selected: "),
42 paragraph(selection_content) | vscroll_indicator | frame | border |
58 window(
text(
"Grid split with different style"),
75 pixel.underlined_double =
true;
85 screen.Loop(renderer);
Component Button(ConstStringRef label, std::function< void()> on_click, ButtonOption options=ButtonOption::Simple())
Draw a button. Execute a function when clicked.
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Draw window with a title and a border around the element.
Element text(std::string_view text)
Display a piece of UTF8 encoded unicode text.
Decorator size(WidthOrHeight direction, Constraint constraint, int value)
Apply a constraint on the size of an element.
Element paragraph(std::string_view the_text)
Return an element drawing the paragraph on multiple lines.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element vbox(Elements children)
A container displaying elements vertically one by one.
The FTXUI ftxui:: namespace.
std::shared_ptr< Node > Element
Element hbox(Elements children)
A container displaying elements horizontally one by one.
Decorator selectionBackgroundColor(Color foreground)
Set the background color of an element when selected. Note that the style is applied on top of the ex...
Decorator selectionColor(Color foreground)
Set the color of an element when selected.
Element selectionStyleReset(Element child)
Reset the selection style of an element.
Decorator selectionStyle(std::function< void(Cell &)> style)
Set the style of an element when selected.