Skip to content
You are viewing documentation for v5.0.0. Switch to latest (main).

ftxui::InputOption ​

cpp
#include <ftxui/component/component_options.hpp>

Option for the Input component.

Examples: component/homescreen, component/input, component/input_style

Summary ​

SymbolDescription
contentThe content of the input.
placeholderThe content of the input when it's empty.
transform
password
multiline< Obscure the input content using '*'.
on_change< Whether the input can be multiline.
on_enterCalled when the user presses enter.
cursor_position

Public Attributes ​

content ​

cpp
StringRef content = "";

The content of the input.

placeholder ​

cpp
StringRef placeholder = "";

The content of the input when it's empty.

transform ​

cpp
std::function< Element(InputState)> transform;

Examples: component/input_style

password ​

cpp
Ref< bool > password = false;

Examples: component/input

multiline ​

cpp
Ref< bool > multiline = true;

< Obscure the input content using '*'.

on_change ​

cpp
std::function< void()> on_change = [] {};

< Whether the input can be multiline.

Called when the content changes.

on_enter ​

cpp
std::function< void()> on_enter = [] {};

Called when the user presses enter.

cursor_position ​

cpp
Ref< int > cursor_position = 0;