Skip to content
You are viewing documentation for v7.0.1. Switch to latest (main).

ftxui::ButtonOption ​

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

Option for the AnimatedButton component.

Examples: component/button, component/button_animated, component/button_in_frame, component/button_style, component/homescreen, component/modal_dialog, component/selection, component/terminal_info

Summary ​

SymbolDescription
label
on_click
transform
animated_colors
AsciiCreate a ButtonOption, highlighted using [] characters.
SimpleCreate a ButtonOption, inverted when focused.
BorderCreate a ButtonOption. The button is shown using a border, inverted when focused. This is the current default.
AnimatedCreate a ButtonOption, using animated colors.

Public Attributes ​

label ​

cpp
ConstStringRef label = "Button";

on_click ​

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

transform ​

cpp
std::function< Element(const EntryState &)> transform;

animated_colors ​

cpp
AnimatedColorsOption animated_colors;

Static Functions ​

Ascii ​

cpp
static ButtonOption Ascii();

Create a ButtonOption, highlighted using [] characters.

Simple ​

cpp
static ButtonOption Simple();

Create a ButtonOption, inverted when focused.

Border ​

cpp
static ButtonOption Border();

Create a ButtonOption. The button is shown using a border, inverted when focused. This is the current default.

Animated ​

cpp
static ButtonOption Animated();

Create a ButtonOption, using animated colors.

Animated ​

Create a ButtonOption, using animated colors.

Animated ​

cpp
static ButtonOption Animated(Color background, Color foreground);

Create a ButtonOption, using animated colors.

Animated ​

cpp
static ButtonOption Animated(Color background, Color foreground, Color background_active, Color foreground_active);

Create a ButtonOption, using animated colors.