Loading...
Searching...
No Matches
InputOption Struct Reference

Option for the Input component. More...

## Static Public Member Functions

static InputOption | Default ()
| Create the default input style:
static InputOption | Spacious ()
| A white on black style with high margins:

## Data Fields

StringRef | content = ""
| The content of the input.
StringRef | placeholder = ""
| The content of the input when it's empty.
std::function< Element(InputState)> | transform
Ref< bool > | password = false
| Obscure the input content using '*'.
Ref< bool > | multiline = true
| Whether the input can be multiline.
Ref< bool > | insert = true
| Insert or overtype character mode.
std::function< void()> | on_change = [] {}
| Called when the content changes.
std::function< void()> | on_enter = [] {}
| Called when the user presses enter.
Ref< int > | cursor_position = 0

## Detailed Description

Option for the Input component.

Examples
  examples/component/homescreen.cpp, examples/component/input.cpp, and examples/component/input_style.cpp.

Definition at line 162 of file component_options.hpp.

## Member Function Documentation

## Default()

InputOption Default | ( |  | ) |

static

Create the default input style:

Standard options for the input component.

Examples
  examples/component/input_style.cpp.

Definition at line 312 of file component_options.cpp.

## Spacious()

InputOption Spacious | ( |  | ) |

static

A white on black style with high margins:

Standard options for a more beautiful input component.

Examples
  examples/component/input_style.cpp.

Definition at line 335 of file component_options.cpp.

## Field Documentation

## content

StringRef content = ""

The content of the input.

Definition at line 171 of file component_options.hpp.

## placeholder

StringRef placeholder = ""

The content of the input when it's empty.

Definition at line 174 of file component_options.hpp.

## transform

std::function<Element(InputState)> transform

Examples
  examples/component/input_style.cpp.

Definition at line 177 of file component_options.hpp.

## password

Ref<bool> password = false

Obscure the input content using '*'.

Examples
  examples/component/input.cpp.

Definition at line 178 of file component_options.hpp.

## multiline

Ref<bool> multiline = true

Whether the input can be multiline.

Definition at line 179 of file component_options.hpp.

## insert

Ref<bool> insert = true

Insert or overtype character mode.

Definition at line 180 of file component_options.hpp.

## on_change

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

Called when the content changes.

Definition at line 183 of file component_options.hpp.

## on_enter

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

Called when the user presses enter.

Definition at line 185 of file component_options.hpp.

## cursor_position

Ref<int> cursor_position = 0

Definition at line 188 of file component_options.hpp.

The documentation for this struct was generated from the following files:

- include/ftxui/component/component_options.hpp
- src/ftxui/component/component_options.cpp