ftxui::InputOption
cpp
#include <ftxui/component/component_options.hpp>Option for the Input component.
Examples: component/homescreen, component/input, component/input_style
Summary
| Symbol | Description |
|---|---|
content | The content of the input. |
placeholder | The content of the input when it's empty. |
transform | |
password | Obscure the input content using '*'. |
multiline | Whether the input can be multiline. |
insert | Insert or overtype character mode. |
on_change | Called when the content changes. |
on_enter | Called when the user presses enter. |
cursor_position | |
Default | Create the default input style: |
Spacious | A white on black style with high margins: |
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.
Examples: component/input
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;Static Functions
Default
cpp
static InputOption Default();Create the default input style:
Standard options for the input component.
Spacious
cpp
static InputOption Spacious();A white on black style with high margins:
Standard options for a more beautiful input component.