17 text(
"FTXUI: A powerful library for building user interfaces."),
18 text(
"Enjoy a rich set of components and a declarative style."),
19 text(
"Create beautiful and responsive UIs with minimal effort."),
20 text(
"Join the community and experience the power of FTXUI."),
30 int selection_change_counter = 0;
31 std::string selection_content =
"";
32 screen.SelectionChange([&] {
33 selection_change_counter++;
34 selection_content = screen.GetSelection();
40 text(
"Select changed: " + std::to_string(selection_change_counter) +
42 text(
"Currently selected: "),
43 paragraph(selection_content) | vscroll_indicator | frame | border |
59 window(
text(
"Grid split with different style"),
86 screen.Loop(renderer);
static ButtonOption Animated()
Create a ButtonOption, using animated colors.
static ScreenInteractive TerminalOutput()
Component Button(ButtonOption options)
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.
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Draw window with a title and a border around the element.
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
Element text(std::wstring text)
Display a piece of unicode text.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element vbox(Elements)
A container displaying elements vertically one by one.
A Unicode character and its associated style.
The FTXUI ftxui:: namespace.
std::shared_ptr< Node > Element
Decorator selectionStyle(std::function< void(Pixel &)> style)
Set the style of an element when selected.
Element hbox(Elements)
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)
Reset the selection style of an element.
Elements paragraph(std::wstring text)