Skip to content
You are viewing documentation for v6.1.6. 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
passwordObscure the input content using '*'.
multilineWhether the input can be multiline.
insertInsert or overtype character mode.
on_changeCalled when the content changes.
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;

Obscure the input content using '*'.

Examples: component/input

multiline ​

cpp
Ref< bool > multiline = true;

Whether the input can be multiline.

insert ​

cpp
Ref< bool > insert = true;

Insert or overtype character mode.

on_change ​

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

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;