Loading...
Searching...
No Matches
ftxui Namespace Reference

## Functions

template<class T, class... Args>
std::shared_ptr< T > | Make (Args &&... args)
Component | operator| (Component component, ComponentDecorator decorator)
Component | operator| (Component component, ElementDecorator decorator)
Component & | operator|= (Component &component, ComponentDecorator decorator)
Component & | operator|= (Component &component, ElementDecorator decorator)
Component | Button (ButtonOption option)
| Draw a button. Execute a function when clicked.
Component | Button (ConstStringRef label, std::function< void()> on_click, ButtonOption option)
| Draw a button. Execute a function when clicked.
Component | Checkbox (CheckboxOption option)
| Draw checkable element.
Component | Checkbox (ConstStringRef label, bool *checked, CheckboxOption option)
| Draw checkable element.
Component | Input (InputOption option)
| An input box for editing text.
Component | Input (StringRef content, InputOption option)
| An input box for editing text.
Component | Input (StringRef content, StringRef placeholder, InputOption option)
| An input box for editing text.
Component | Menu (MenuOption option)
| A list of text. The focused element is selected.
Component | Menu (ConstStringListRef entries, int *selected, MenuOption option)
| A list of text. The focused element is selected.
Component | MenuEntry (MenuEntryOption option)
| A specific menu entry. They can be put into a Container::Vertical to form a menu.
Component | MenuEntry (ConstStringRef label, MenuEntryOption option)
| A specific menu entry. They can be put into a Container::Vertical to form a menu.
Component | Radiobox (RadioboxOption option)
| A list of element, where only one can be selected.
Component | Radiobox (ConstStringListRef entries, int *selected, RadioboxOption option)
| A list of element, where only one can be selected.
Component | Dropdown (ConstStringListRef entries, int *selected)
| A dropdown menu.
Component | Dropdown (DropdownOption option)
| A dropdown menu.
Component | Toggle (ConstStringListRef entries, int *selected)
| An horizontal list of elements. The user can navigate through them.
template<typename T>
Component | Slider (SliderOption< T > options)
| A slider in any direction.
Component | Slider (ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)
| An horizontal slider.
Component | Slider (ConstStringRef label, Ref< float > value, ConstRef< float > min=0.f, ConstRef< float > max=100.f, ConstRef< float > increment=5.f)
Component | Slider (ConstStringRef label, Ref< long > value, ConstRef< long > min=0L, ConstRef< long > max=100L, ConstRef< long > increment=5L)
Component | ResizableSplit (ResizableSplitOption options)
| A split in between two components.
Component | ResizableSplitLeft (Component main, Component back, int *main_size)
| An horizontal split in between two components, configurable using the mouse.
Component | ResizableSplitRight (Component main, Component back, int *main_size)
| An horizontal split in between two components, configurable using the mouse.
Component | ResizableSplitTop (Component main, Component back, int *main_size)
| An vertical split in between two components, configurable using the mouse.
Component | ResizableSplitBottom (Component main, Component back, int *main_size)
| An vertical split in between two components, configurable using the mouse.
Component | Renderer (Component child, std::function< Element()> render)
| Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Component | Renderer (std::function< Element()> render)
| Return a component, using |render| to render its interface.
Component | Renderer (std::function< Element(bool)> render)
| Return a focusable component, using |render| to render its interface.
ComponentDecorator | Renderer (ElementDecorator decorator)
| Decorate a component, by decorating what it renders.
Component | CatchEvent (Component child, std::function< bool(Event)>)
ComponentDecorator | CatchEvent (std::function< bool(Event)> on_event)
| Decorate a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
Component | Maybe (Component child, const bool *show)
| Decorate a component |child|. It is shown only when |show| is true.
Component | Maybe (Component child, std::function< bool()> show)
| Decorate a component |child|. It is shown only when |show| returns true.
ComponentDecorator | Maybe (const bool *show)
| Decorate a component. It is shown only when |show| is true.
ComponentDecorator | Maybe (std::function< bool()> show)
| Decorate a component. It is shown only when the |show| function returns true.
Component | Modal (Component main, Component modal, const bool *show_modal)
ComponentDecorator | Modal (Component modal, const bool *show_modal)
Component | Collapsible (ConstStringRef label, Component child, Ref< bool > show=false)
Component | Hoverable (Component component, bool *hover)
| Wrap a component. Gives the ability to know if it is hovered by the mouse.
Component | Hoverable (Component component, std::function< void()> on_enter, std::function< void()> on_leave)
| Wrap a component. Uses callbacks.
Component | Hoverable (Component component, std::function< void(bool)> on_change)
| Wrap a component. Gives the ability to know if it is hovered by the mouse.
ComponentDecorator | Hoverable (bool *hover)
| Wrap a component. Gives the ability to know if it is hovered by the mouse.
ComponentDecorator | Hoverable (std::function< void()> on_enter, std::function< void()> on_leave)
| Wrap a component. Gives the ability to know if it is hovered by the mouse.
ComponentDecorator | Hoverable (std::function< void(bool)> on_change)
| Wrap a component. Gives the ability to know if it is hovered by the mouse.
Component | Window (WindowOptions option)
| A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;.
template<class T>
Receiver< T > | MakeReceiver ()
Element | text (std::wstring text)
| Display a piece of unicode text.
Element | vtext (std::wstring text)
| Display a piece unicode text vertically.
Elements | paragraph (std::wstring text)
Element | operator| (Element element, Decorator decorator)
| From an element, apply a decorator.
Element & | operator|= (Element &e, Decorator d)
| Apply a decorator to an element.
Elements | operator| (Elements elements, Decorator decorator)
| From a set of element, apply a decorator to every elements.
Decorator | operator| (Decorator a, Decorator b)
| Compose two decorator into one.
Element | text (std::string text)
| Display a piece of UTF8 encoded unicode text.
Element | vtext (std::string text)
| Display a piece of unicode text vertically.
Element | separator ()
| Draw a vertical or horizontal separation in between two other elements.
Element | separatorLight ()
| Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
Element | separatorDashed ()
| Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
Element | separatorHeavy ()
| Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
Element | separatorDouble ()
| Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
Element | separatorEmpty ()
| Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
Element | separatorStyled (BorderStyle style)
| Draw a vertical or horizontal separation in between two other elements.
Element | separator (Pixel pixel)
| Draw a separator in between two element filled with a given pixel.
Element | separatorCharacter (std::string value)
| Draw a vertical or horizontal separation in between two other elements.
Element | separatorHSelector (float left, float right, Color unselected_color, Color selected_color)
| Draw an horizontal bar, with the area in between left/right colored differently.
Element | separatorVSelector (float up, float down, Color unselected_color, Color selected_color)
| Draw an vertical bar, with the area in between up/downcolored differently.
Element | gauge (float progress)
| Draw a high definition progress bar.
Element | gaugeLeft (float progress)
| Draw a high definition progress bar progressing from right to left.
Element | gaugeRight (float progress)
| Draw a high definition progress bar progressing from left to right.
Element | gaugeUp (float progress)
| Draw a high definition progress bar progressing from bottom to top.
Element | gaugeDown (float progress)
| Draw a high definition progress bar progressing from top to bottom.
Element | gaugeDirection (float progress, Direction direction)
| Draw a high definition progress bar progressing in specified direction.
Element | border (Element child)
| Draw a border around the element.
Element | borderLight (Element child)
| Draw a light border around the element.
Element | borderDashed (Element child)
| Draw a dashed border around the element.
Element | borderHeavy (Element child)
| Draw a heavy border around the element.
Element | borderDouble (Element child)
| Draw a double border around the element.
Element | borderRounded (Element child)
| Draw a rounded border around the element.
Element | borderEmpty (Element child)
| Draw an empty border around the element.
Decorator | borderStyled (BorderStyle style)
| Same as border but with different styles.
Decorator | borderStyled (BorderStyle style, Color foreground_color)
| Same as border but with a foreground color and a different style.
Decorator | borderStyled (Color foreground_color)
| Same as border but with a foreground color.
Decorator | borderWith (const Pixel &pixel)
| Same as border but with a constant Pixel around the element.
Element | window (Element title, Element content, BorderStyle border)
| Draw window with a title and a border around the element.
Element | spinner (int charset_index, size_t image_index)
| Useful to represent the effect of time and/or events. This display an ASCII art "video".
Element | paragraph (const std::string &the_text)
| Return an element drawing the paragraph on multiple lines.
Element | paragraphAlignLeft (const std::string &the_text)
| Return an element drawing the paragraph on multiple lines, aligned on the left.
Element | paragraphAlignRight (const std::string &the_text)
| Return an element drawing the paragraph on multiple lines, aligned on the right.
Element | paragraphAlignCenter (const std::string &the_text)
| Return an element drawing the paragraph on multiple lines, aligned on the center.
Element | paragraphAlignJustify (const std::string &the_text)
| Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center.
Element | graph (GraphFunction graph_function)
| Draw a graph using a GraphFunction.
Element | emptyElement ()
Element | canvas (ConstRef< Canvas > canvas)
| Produce an element from a Canvas, or a reference to a Canvas.
Element | canvas (int width, int height, std::function< void(Canvas &)> fn)
| Produce an element drawing a canvas of requested size.
Element | canvas (std::function< void(Canvas &)> fn)
| Produce an element drawing a canvas.
Element | bold (Element child)
| Use a bold font, for elements with more emphasis.
Element | dim (Element child)
| Use a light font, for elements with less emphasis.
Element | italic (Element child)
| Apply a underlinedDouble to text.
Element | inverted (Element child)
| Add a filter that will invert the foreground and the background colors.
Element | underlined (Element child)
| Make the underlined element to be underlined.
Element | underlinedDouble (Element child)
| Apply a underlinedDouble to text.
Element | blink (Element child)
| The text drawn alternates in between visible and hidden.
Element | strikethrough (Element child)
| Apply a strikethrough to text.
Decorator | color (Color c)
| Decorate using a foreground color.
Decorator | bgcolor (Color color)
| Decorate using a background color.
Decorator | color (const LinearGradient &gradient)
| Decorate using a linear-gradient effect on the foreground color.
Decorator | bgcolor (const LinearGradient &gradient)
| Decorate using a linear-gradient effect on the background color.
Element | color (Color color, Element child)
| Set the foreground color of an element.
Element | bgcolor (Color color, Element child)
| Set the background color of an element.
Element | color (const LinearGradient &gradient, Element child)
| Set the foreground color of an element with linear-gradient effect.
Element | bgcolor (const LinearGradient &gradient, Element child)
| Set the background color of an element with linear-gradient effect.
Decorator | focusPosition (int x, int y)
| Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in the numbers of cells.
Decorator | focusPositionRelative (float x, float y)
| Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in proportion of the requested size.
Element | automerge (Element child)
| Enable character to be automatically merged with others nearby.
Decorator | hyperlink (std::string link)
| Decorate using an hyperlink. The link will be opened when the user click on it. This is supported only on a limited set of terminal emulator. List: https://github.com/Alhadis/OSC8-Adoption/.
Element | hyperlink (std::string link, Element child)
| Make the rendered area clickable using a web browser. The link will be opened when the user click on it. This is supported only on a limited set of terminal emulator. List: https://github.com/Alhadis/OSC8-Adoption/.
Element | selectionStyleReset (Element child)
| Reset the selection style of an element.
Decorator | selectionColor (Color foreground)
| Set the color of an element when selected.
Decorator | selectionBackgroundColor (Color foreground)
| Set the background color of an element when selected. Note that the style is applied on top of the existing style.
Decorator | selectionForegroundColor (Color foreground)
| Set the foreground color of an element when selected. Note that the style is applied on top of the existing style.
Decorator | selectionStyle (std::function< void(Pixel &)> style)
| Set the style of an element when selected.
Element | hbox (Elements children)
| A container displaying elements horizontally one by one.
Element | vbox (Elements children)
| A container displaying elements vertically one by one.
Element | dbox (Elements children_)
| Stack several element on top of each other.
Element | flexbox (Elements children, FlexboxConfig config)
| A container displaying elements on row/columns and capable of wrapping on the next column/row when full.
Element | gridbox (std::vector< Elements > lines)
| A container displaying a grid of elements.
Element | hflow (Elements children)
| A container displaying elements in rows from left to right. When filled, it starts on a new row below.
Element | vflow (Elements children)
| A container displaying elements in rows from top to bottom. When filled, it starts on a new columns on the right. filled, it starts on a new row. is full, it starts a new row.
Element | flex (Element child)
| Make a child element to expand proportionally to the space left in a container.
Element | flex_grow (Element child)
| Expand if possible.
Element | flex_shrink (Element child)
| Minimize if needed.
Element | xflex (Element child)
| Expand/Minimize if possible/needed on the X axis.
Element | xflex_grow (Element child)
| Expand if possible on the X axis.
Element | xflex_shrink (Element child)
| Minimize if needed on the X axis.
Element | yflex (Element child)
| Expand/Minimize if possible/needed on the Y axis.
Element | yflex_grow (Element child)
| Expand if possible on the Y axis.
Element | yflex_shrink (Element child)
| Minimize if needed on the Y axis.
Element | notflex (Element child)
| Make the element not flexible.
Element | filler ()
| An element that will take expand proportionally to the space left in a container.
Decorator | size (WidthOrHeight direction, Constraint constraint, int value)
| Apply a constraint on the size of an element.
Element | frame (Element child)
| Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container. In this case only a smaller portion is displayed. The view is scrollable to make the focused element visible.
Element | xframe (Element child)
| Same as frame, but only on the x-axis.
Element | yframe (Element child)
| Same as frame, but only on the y-axis.
Element | focus (Element child)
| Set the child to be the one focused among its siblings.
Element | select (Element child)
| Set the child to be the one focused among its siblings.
Element | focusCursorBlock (Element child)
| Same as focus, but set the cursor shape to be a still block.
Element | focusCursorBlockBlinking (Element child)
| Same as focus, but set the cursor shape to be a blinking block.
Element | focusCursorBar (Element child)
| Same as focus, but set the cursor shape to be a still block.
Element | focusCursorBarBlinking (Element child)
| Same as focus, but set the cursor shape to be a blinking bar.
Element | focusCursorUnderline (Element child)
| Same as focus, but set the cursor shape to be a still underline.
Element | focusCursorUnderlineBlinking (Element child)
| Same as focus, but set the cursor shape to be a blinking underline.
Element | vscroll_indicator (Element child)
| Display a vertical scrollbar to the right. colors.
Element | hscroll_indicator (Element child)
| Display an horizontal scrollbar to the bottom. colors.
Decorator | reflect (Box &box)
Element | clear_under (Element element)
| Before drawing |child|, clear the pixels below. This is useful in.
Element | hcenter (Element child)
| Center an element horizontally.
Element | vcenter (Element child)
| Center an element vertically.
Element | center (Element child)
| Center an element horizontally and vertically.
Element | align_right (Element child)
| Align an element on the right side.
Element | nothing (Element element)
| A decoration doing absolutely nothing.
void | Render (Screen &screen, const Element &element)
| Display an element on a ftxui::Screen.
void | Render (Screen &screen, Node *node)
| Display an element on a ftxui::Screen.
void | Render (Screen &screen, Node *node, Selection &selection)
std::string | GetNodeSelectedContent (Screen &screen, Node *node, Selection &selection)
Color | operator""_rgb (unsigned long long int combined)
| Creates a color from a combined hex RGB representation, e.g. 0x808000_rgb.
ColorInfo | GetColorInfo (Color::Palette256 index)
ColorInfo | GetColorInfo (Color::Palette16 index)
int | wchar_width (wchar_t)
int | wstring_width (const std::wstring &)
std::string | to_string (const std::wstring &s)
| Convert a UTF8 std::string into a std::wstring.
std::wstring | to_wstring (const std::string &s)
| Convert a std::wstring into a UTF8 std::string.
template<typename T>
std::wstring | to_wstring (T s)
int | string_width (const std::string &)
std::vector< std::string > | Utf8ToGlyphs (const std::string &input)
std::vector< int > | CellToGlyphIndex (const std::string &input)
Component | CatchEvent (Component child, std::function< bool(Event event)> on_event)
| Return a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
template Component | Slider (SliderOption< int8_t >)
template Component | Slider (SliderOption< int16_t >)
template Component | Slider (SliderOption< int32_t >)
template Component | Slider (SliderOption< int64_t >)
template Component | Slider (SliderOption< uint8_t >)
template Component | Slider (SliderOption< uint16_t >)
template Component | Slider (SliderOption< uint32_t >)
template Component | Slider (SliderOption< uint64_t >)
template Component | Slider (SliderOption< float >)
template Component | Slider (SliderOption< double >)
bool | EatCodePoint (const std::string &input, size_t start, size_t *end, uint32_t *ucs)
bool | EatCodePoint (const std::wstring &input, size_t start, size_t *end, uint32_t *ucs)
bool | IsCombining (uint32_t ucs)
bool | IsFullWidth (uint32_t ucs)
bool | IsControl (uint32_t ucs)
WordBreakProperty | CodepointToWordBreakProperty (uint32_t codepoint)
size_t | GlyphPrevious (const std::string &input, size_t start)
size_t | GlyphNext (const std::string &input, size_t start)
size_t | GlyphIterate (const std::string &input, int glyph_offset, size_t start)
int | GlyphCount (const std::string &input)
std::vector< WordBreakProperty > | Utf8ToWordBreakProperty (const std::string &input)
bool | IsWordBreakingCharacter (const std::string &input, size_t glyph_index)

## Enumerations

enum class | Direction { Up = 0 , Down = 1 , Left = 2 , Right = 3 }
enum | BorderStyle { LIGHT , DASHED , HEAVY , DOUBLE , ROUNDED , EMPTY }
enum | WidthOrHeight { WIDTH , HEIGHT }
enum | Constraint { LESS_THAN , EQUAL , GREATER_THAN }
enum class | WordBreakProperty : int8_t { ALetter , CR , Double_Quote , Extend , ExtendNumLet , Format , Hebrew_Letter , Katakana , LF , MidLetter , MidNum , MidNumLet , Newline , Numeric , Regional_Indicator , Single_Quote , WSegSpace , ZWJ }

## Typedefs

using | CapturedMouse = std::unique_ptr<CapturedMouseInterface>
using | ComponentDecorator = std::function<Component(Component)>
using | ElementDecorator = std::function<Element(Element)>
using | Component = std::shared_ptr<ComponentBase>
using | Components = std::vector<Component>
template<class T>
using | Sender = std::unique_ptr<SenderImpl<T>>
template<class T>
using | Receiver = std::unique_ptr<ReceiverImpl<T>>
using | Closure = std::function<void()>
using | Task = std::variant<Event, Closure, AnimationTask>
using | Element = std::shared_ptr<Node>
using | Elements = std::vector<Element>
using | Decorator = std::function<Element(Element)>
using | GraphFunction = std::function<std::vector<int>(int, int)>

## Data Structures

class | CapturedMouseInterface
class | ComponentBase
| It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event. More...
struct | EntryState
| arguments for |ButtonOption::transform|, |CheckboxOption::transform|, |Radiobox::transform|, |MenuEntryOption::transform|, |MenuOption::transform|. More...
struct | UnderlineOption
struct | AnimatedColorOption
| Option about a potentially animated color. More...
struct | AnimatedColorsOption
struct | MenuEntryOption
| Option for the MenuEntry component. More...
struct | MenuOption
| Option for the Menu component. More...
struct | ButtonOption
| Option for the AnimatedButton component. More...
struct | CheckboxOption
| Option for the Checkbox component. More...
struct | InputState
| Used to define style for the Input component. More...
struct | InputOption
| Option for the Input component. More...
struct | RadioboxOption
| Option for the Radiobox component. More...
struct | ResizableSplitOption
struct | SliderOption
struct | WindowRenderState
struct | WindowOptions
struct | DropdownOption
| Option for the Dropdown component.A dropdown menu is a checkbox opening/closing a radiobox. More...
struct | Event
| Represent an event. It can be key press event, a terminal resize, or more ... More...
class | Loop
struct | Mouse
| A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift, ctrl, meta). More...
class | SenderImpl
class | ReceiverImpl
class | ScreenInteractive
class | AnimationTask
struct | Canvas
struct | FlexboxConfig
struct | LinearGradient
| A class representing the settings for linear-gradient color effect. More...
class | Node
struct | Requirement
class | Selection
| Represent a selection in the terminal. More...
class | Table
class | TableSelection
struct | Box
class | Color
| A class representing terminal colors. More...
struct | ColorInfo
class | Image
| A rectangular grid of Pixel. More...
struct | Pixel
| A Unicode character and its associated style. More...
class | Screen
| A rectangular grid of Pixel. More...
struct | Dimensions
class | AutoReset
| Assign a value to a variable, reset its old value when going out of scope. More...
class | ConstRef
| An adapter. Own or reference an immutable object. More...
class | Ref
| An adapter. Own or reference an mutable object. More...
class | StringRef
| An adapter. Own or reference a constant string. For convenience, this class convert multiple mutable string toward a shared representation. More...
class | ConstStringRef
| An adapter. Own or reference a constant string. For convenience, this class convert multiple immutable string toward a shared representation. More...
class | ConstStringListRef
| An adapter. Reference a list of strings. More...
class | TerminalInputParser
class | NodeDecorator

## Namespaces

namespace | animation
namespace | Container
namespace | Dimension
| Define how the Screen's dimensions should look like.
namespace | literals
namespace | Terminal
namespace | box_helper
namespace | flexbox_helper
namespace | util

## Variables

const std::map< std::string, std::string > | g_uniformize
const std::array< ColorInfo, 256 > | palette256

## Data Structure Documentation

## ftxui::EntryState

struct ftxui::EntryState

arguments for |ButtonOption::transform|, |CheckboxOption::transform|, |Radiobox::transform|, |MenuEntryOption::transform|, |MenuOption::transform|.

Examples
  examples/component/dropdown_custom.cpp, examples/component/menu_entries.cpp, and examples/component/menu_style.cpp.

Definition at line 23 of file component_options.hpp.

Data Fields
string | label | The label to display.
bool | state | The state of the button/checkbox/radiobox.
bool | active | Whether the entry is the active one.
bool | focused | Whether the entry is one focused by the user.
int | index | Index of the entry when applicable or -1.

## ftxui::AnimatedColorsOption

struct ftxui::AnimatedColorsOption

Definition at line 70 of file component_options.hpp.

Data Fields
AnimatedColorOption | background |
AnimatedColorOption | foreground |

## ftxui::MenuEntryOption

struct ftxui::MenuEntryOption

Option for the MenuEntry component.

Examples
  examples/component/menu_entries.cpp, and examples/component/menu_entries_animated.cpp.

Definition at line 77 of file component_options.hpp.

Data Fields
ConstStringRef | label = "MenuEntry" |
function< Element(const EntryState &state)> | transform |
AnimatedColorsOption | animated_colors |

## ftxui::InputState

struct ftxui::InputState

Used to define style for the Input component.

Examples
  examples/component/input_style.cpp.

Definition at line 152 of file component_options.hpp.

Data Fields
Element | element |
bool | hovered | Whether the input is hovered by the mouse.
bool | focused | Whether the input is focused by the user.
bool | is_placeholder | Whether the input is empty and displaying the placeholder.

## ftxui::ResizableSplitOption

struct ftxui::ResizableSplitOption

Definition at line 210 of file component_options.hpp.

Data Fields
Component | main |
Component | back |
Ref< Direction > | direction = Direction::Left |
Ref< int > | main_size |
function< Element()> | separator_func = [] { return ::ftxui::separator(); } |

## ftxui::SliderOption

struct ftxui::SliderOption

template<typename T>
struct ftxui::SliderOption< T >

Examples
  examples/component/scrollbar.cpp, and examples/component/slider_direction.cpp.

Definition at line 223 of file component_options.hpp.

Data Fields
Ref< T > | value |
ConstRef< T > | min = T(0) |
ConstRef< T > | max = T(100) |
ConstRef< T > | increment = (max() - min()) / 20 |
Direction | direction = Direction::Right |
Color | color_active = Color::White |
Color | color_inactive = Color::GrayDark |
function< void()> | on_change |

## ftxui::WindowRenderState

struct ftxui::WindowRenderState

Definition at line 235 of file component_options.hpp.

Data Fields
Element | inner | The element wrapped inside this window.
const string & | title | The title of the window.
bool | active = false | Whether the window is the active one.
bool | drag = false | Whether the window is being dragged.
bool | resize = false | Whether the window is being resized.
bool | hover_left = false | Whether the resizeable left side is hovered.
bool | hover_right = false | Whether the resizeable right side is hovered.
bool | hover_top = false | Whether the resizeable top side is hovered.
bool | hover_down = false | Whether the resizeable down side is hovered.

## ftxui::WindowOptions

struct ftxui::WindowOptions

Definition at line 249 of file component_options.hpp.

Data Fields
Component | inner | The component wrapped by this window.
ConstStringRef | title = "" | The title displayed by this window.
Ref< int > | left = 0 | The left side position of the window.
Ref< int > | top = 0 | The top side position of the window.
Ref< int > | width = 20 | The width of the window.
Ref< int > | height = 10 | The height of the window.
Ref< bool > | resize_left = true | Can the left side be resized?
Ref< bool > | resize_right = true | Can the right side be resized?
Ref< bool > | resize_top = true | Can the top side be resized?
Ref< bool > | resize_down = true | Can the down side be resized?
function< Element(const WindowRenderState &)> | render | An optional function to customize how the window looks like:

## ftxui::DropdownOption

struct ftxui::DropdownOption

Option for the Dropdown component.

A dropdown menu is a checkbox opening/closing a radiobox.

Definition at line 270 of file component_options.hpp.

Data Fields
Ref< bool > | open = false | Whether the dropdown is open or closed:
CheckboxOption | checkbox |
RadioboxOption | radiobox |
function< Element(bool open, Element checkbox, Element radiobox)> | transform |

## ftxui::AnimationTask

class ftxui::AnimationTask

Definition at line 12 of file task.hpp.

## ftxui::Requirement

struct ftxui::Requirement

Definition at line 13 of file requirement.hpp.

Data Fields
int | min_x = 0 |
int | min_y = 0 |
int | flex_grow_x = 0 |
int | flex_grow_y = 0 |
int | flex_shrink_x = 0 |
int | flex_shrink_y = 0 |
Focused | focused |

## ftxui::ColorInfo

struct ftxui::ColorInfo

Definition at line 12 of file color_info.hpp.

Data Fields
const char * | name |
uint8_t | index_256 |
uint8_t | index_16 |
uint8_t | red |
uint8_t | green |
uint8_t | blue |
uint8_t | hue |
uint8_t | saturation |
uint8_t | value |

## ftxui::Dimensions

struct ftxui::Dimensions

Definition at line 8 of file terminal.hpp.

Data Fields
int | dimx |
int | dimy |

## Typedef Documentation

## CapturedMouse

using CapturedMouse = std::unique_ptr<CapturedMouseInterface>

Definition at line 19 of file captured_mouse.hpp.

## ComponentDecorator

using ComponentDecorator = std::function<Component(Component)>

Definition at line 31 of file component.hpp.

## ElementDecorator

using ElementDecorator = std::function<Element(Element)>

Definition at line 32 of file component.hpp.

## Component

typedef std::shared_ptr< ComponentBase > Component = std::shared_ptr<ComponentBase>

Examples
  examples/component/collapsible.cpp, examples/component/focus_cursor.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/input_in_frame.cpp, examples/component/menu2.cpp, examples/component/menu_multiple.cpp, examples/component/menu_style.cpp, examples/component/menu_underline_animated_gallery.cpp, examples/component/modal_dialog.cpp, examples/component/scrollbar.cpp, examples/component/toggle.cpp, and examples/component/window.cpp.

Definition at line 24 of file component_base.hpp.

## Components

using Components = std::vector<Component>

Definition at line 25 of file component_base.hpp.

## Sender

template<class T>

using Sender = std::unique_ptr<SenderImpl<T>>

Definition at line 45 of file receiver.hpp.

## Receiver

template<class T>

using Receiver = std::unique_ptr<ReceiverImpl<T>>

Definition at line 46 of file receiver.hpp.

## Closure

using Closure = std::function<void()>

Definition at line 13 of file task.hpp.

## Task

using Task = std::variant<Event, Closure, AnimationTask>

Examples
  examples/dom/package_manager.cpp.

Definition at line 14 of file task.hpp.

## Element

typedef std::shared_ptr< Node > Element = std::shared_ptr<Node>

Examples
  examples/component/dropdown_custom.cpp, examples/component/focus.cpp, examples/component/menu_entries.cpp, examples/component/menu_style.cpp, examples/component/modal_dialog.cpp, examples/component/modal_dialog_custom.cpp, examples/component/selection.cpp, and examples/component/slider_rgb.cpp.

Definition at line 22 of file elements.hpp.

## Elements

typedef std::vector< Element > Elements = std::vector<Element>

Examples
  examples/component/homescreen.cpp, examples/component/print_key_press.cpp, examples/dom/color_gallery.cpp, examples/dom/color_info_palette256.cpp, examples/dom/color_truecolor_HSV.cpp, examples/dom/color_truecolor_RGB.cpp, and examples/dom/size.cpp.

Definition at line 23 of file elements.hpp.

## Decorator

using Decorator = std::function<Element(Element)>

Examples
  examples/component/focus_cursor.cpp.

Definition at line 24 of file elements.hpp.

## GraphFunction

using GraphFunction = std::function<std::vector<int>(int, int)>

Definition at line 25 of file elements.hpp.

## Enumeration Type Documentation

## Direction

enum class Direction

strong

Enumerator
Up |
Down |
Left |
Right |

Definition at line 8 of file direction.hpp.

## BorderStyle

enum BorderStyle

Enumerator
LIGHT |
DASHED |
HEAVY |
DOUBLE |
ROUNDED |
EMPTY |

Definition at line 27 of file elements.hpp.

## WidthOrHeight

enum WidthOrHeight

Enumerator
WIDTH |
HEIGHT |

Definition at line 153 of file elements.hpp.

## Constraint

enum Constraint

Enumerator
LESS_THAN |
EQUAL |
GREATER_THAN |

Definition at line 154 of file elements.hpp.

## WordBreakProperty

enum class WordBreakProperty : int8_t

strong

Enumerator
ALetter |
CR |
Double_Quote |
Extend |
ExtendNumLet |
Format |
Hebrew_Letter |
Katakana |
LF |
MidLetter |
MidNum |
MidNumLet |
Newline |
Numeric |
Regional_Indicator |
Single_Quote |
WSegSpace |
ZWJ |

Definition at line 40 of file string_internal.hpp.

## Function Documentation

## Make()

template<class T, class... Args>

std::shared_ptr< T > Make | ( | Args &&... | args | ) |

Examples
  examples/component/scrollbar.cpp, and examples/component/window.cpp.

Definition at line 26 of file component.hpp.

## operator|() [1/5]

Component operator| | ( | Component | component,
|  | ComponentDecorator | decorator )

Definition at line 12 of file util.cpp.

## operator|() [2/5]

Component operator| | ( | Component | component,
|  | ElementDecorator | decorator )

Definition at line 17 of file util.cpp.

## operator|=() [1/3]

Component & operator|= | ( | Component & | component,
|  | ComponentDecorator | decorator )

Definition at line 22 of file util.cpp.

## operator|=() [2/3]

Component & operator|= | ( | Component & | component,
|  | ElementDecorator | decorator )

Definition at line 28 of file util.cpp.

## Button() [1/2]

Component Button | ( | ButtonOption | option | ) |

Draw a button. Execute a function when clicked.

Parameters

  option | Additional optional parameters.

See also
  ButtonBase

### Example

auto screen = ScreenInteractive::FitComponent();
Component button = Button({
.label = "Click to quit",
.on_click = screen.ExitLoopClosure(),
});
screen.Loop(button)
ftxui::ScreenInteractive::FitComponent
static ScreenInteractive FitComponent()
Definition screen_interactive.cpp:416
ftxui::Button
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
Definition button.cpp:176
ftxui::Component
std::shared_ptr< ComponentBase > Component
Definition component_base.hpp:24

### Output

┌─────────────┐
│Click to quit│
└─────────────┘

Examples
  examples/component/button_animated.cpp, examples/component/button_in_frame.cpp, examples/component/button_style.cpp, examples/component/composition.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/modal_dialog.cpp, examples/component/modal_dialog_custom.cpp, examples/component/nested_screen.cpp, examples/component/renderer.cpp, examples/component/selection.cpp, and examples/component/with_restored_io.cpp.

Definition at line 176 of file button.cpp.

## Button() [2/2]

Component Button | ( | ConstStringRef | label,
|  | std::function< void()> | on_click,
|  | ButtonOption | option )

Draw a button. Execute a function when clicked.

Parameters

  label | The label of the button.
  on_click | The action to execute when clicked.
  option | Additional optional parameters.

See also
  ButtonBase

### Example

auto screen = ScreenInteractive::FitComponent();
std::string label = "Click to quit";
Component button = Button(&label, screen.ExitLoopClosure());
screen.Loop(button)

### Output

┌─────────────┐
│Click to quit│
└─────────────┘

Definition at line 204 of file button.cpp.

## Checkbox() [1/2]

Component Checkbox | ( | CheckboxOption | option | ) |

Draw checkable element.

Parameters

  option | Additional optional parameters.

See also
  CheckboxBase

### Example

auto screen = ScreenInteractive::FitComponent();
CheckboxOption option;
option.label = "Make a sandwidth";
option.checked = false;
Component checkbox = Checkbox(option);
screen.Loop(checkbox)
ftxui::Checkbox
Component Checkbox(CheckboxOption options)
Draw checkable element.
Definition checkbox.cpp:108
ftxui::CheckboxOption
Option for the Checkbox component.
Definition component_options.hpp:135
ftxui::CheckboxOption::label
ConstStringRef label
Definition component_options.hpp:139
ftxui::CheckboxOption::checked
Ref< bool > checked
Definition component_options.hpp:141

### Output

☐ Make a sandwitch

Examples
  examples/component/checkbox.cpp, examples/component/checkbox_in_frame.cpp, examples/component/flexbox_gallery.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/maybe.cpp, and examples/component/window.cpp.

Definition at line 108 of file checkbox.cpp.

## Checkbox() [2/2]

Component Checkbox | ( | ConstStringRef | label,
|  | bool * | checked,
|  | CheckboxOption | option )

Draw checkable element.

Parameters

  label | The label of the checkbox.
  checked | Whether the checkbox is checked or not.
  option | Additional optional parameters.

See also
  CheckboxBase

### Example

auto screen = ScreenInteractive::FitComponent();
std::string label = "Make a sandwidth";
bool checked = false;
Component checkbox = Checkbox(&label, &checked);
screen.Loop(checkbox)

### Output

☐ Make a sandwitch

Definition at line 135 of file checkbox.cpp.

## Input() [1/3]

Component Input | ( | InputOption | option | ) |

An input box for editing text.

Parameters

  option | Additional optional parameters.

See also
  InputBase

### Example

auto screen = ScreenInteractive::FitComponent();
std::string content= "";
std::string placeholder = "placeholder";
Component input = Input({
.content = &content,
.placeholder = &placeholder,
})
screen.Loop(input);
ftxui::Input
Component Input(InputOption options={})
An input box for editing text.
Definition input.cpp:571

### Output

placeholder

Examples
  examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/input_in_frame.cpp, examples/component/input_style.cpp, and examples/component/textarea.cpp.

Definition at line 571 of file input.cpp.

## Input() [2/3]

Component Input | ( | StringRef | content,
|  | InputOption | option )

An input box for editing text.

Parameters

  content | The editable content.
  option | Additional optional parameters.

See also
  InputBase

### Example

auto screen = ScreenInteractive::FitComponent();
std::string content= "";
std::string placeholder = "placeholder";
Component input = Input(content, {
.placeholder = &placeholder,
.password = true,
})
screen.Loop(input);

### Output

placeholder

Definition at line 599 of file input.cpp.

## Input() [3/3]

Component Input | ( | StringRef | content,
|  | StringRef | placeholder,
|  | InputOption | option )

An input box for editing text.

Parameters

  content | The editable content.
  option | Additional optional parameters.

See also
  InputBase

### Example

auto screen = ScreenInteractive::FitComponent();
std::string content= "";
std::string placeholder = "placeholder";
Component input = Input(content, placeholder);
screen.Loop(input);

### Output

placeholder

Definition at line 625 of file input.cpp.

## Menu() [1/2]

Component Menu | ( | MenuOption | option | ) |

A list of text. The focused element is selected.

Parameters

  option | a structure containing all the paramters.

### Example

auto screen = ScreenInteractive::TerminalOutput();
std::vector<std::string> entries = {
"entry 1",
"entry 2",
"entry 3",
};
int selected = 0;
auto menu = Menu({
.entries = &entries,
.selected = &selected,
});
screen.Loop(menu);
ftxui::ScreenInteractive::TerminalOutput
static ScreenInteractive TerminalOutput()
Definition screen_interactive.cpp:406
ftxui::Menu
Component Menu(MenuOption options)
A list of text. The focused element is selected.
Definition menu.cpp:512

### Output

> entry 1
entry 2
entry 3

Examples
  examples/component/canvas_animated.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/menu.cpp, examples/component/menu2.cpp, examples/component/menu_in_frame.cpp, examples/component/menu_in_frame_horizontal.cpp, examples/component/menu_multiple.cpp, examples/component/menu_style.cpp, examples/component/menu_underline_animated_gallery.cpp, and examples/component/tab_vertical.cpp.

Definition at line 512 of file menu.cpp.

## Menu() [2/2]

Component Menu | ( | ConstStringListRef | entries,
|  | int * | selected,
|  | MenuOption | option )

A list of text. The focused element is selected.

Parameters

  entries | The list of entries in the menu.
  selected | The index of the currently selected element.
  option | Additional optional parameters.

### Example

auto screen = ScreenInteractive::TerminalOutput();
std::vector<std::string> entries = {
"entry 1",
"entry 2",
"entry 3",
};
int selected = 0;
auto menu = Menu(&entries, &selected);
screen.Loop(menu);

### Output

> entry 1
entry 2
entry 3

Definition at line 543 of file menu.cpp.

## MenuEntry() [1/2]

Component MenuEntry | ( | MenuEntryOption | option | ) |

A specific menu entry. They can be put into a Container::Vertical to form a menu.

Parameters

  option | The parameters.

### Example

auto screen = ScreenInteractive::TerminalOutput();
int selected = 0;
auto menu = Container::Vertical({
MenuEntry({.label = "entry 1"}),
MenuEntry({.label = "entry 2"}),
MenuEntry({.label = "entry 3"}),
}, &selected);
screen.Loop(menu);
ftxui::Container::Vertical
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
Definition container.cpp:317
ftxui::MenuEntry
Component MenuEntry(MenuEntryOption options)
A specific menu entry. They can be put into a Container::Vertical to form a menu.
Definition menu.cpp:614

### Output

> entry 1
entry 2
entry 3

Examples
  examples/component/menu_entries.cpp, and examples/component/menu_entries_animated.cpp.

Definition at line 614 of file menu.cpp.

## MenuEntry() [2/2]

Component MenuEntry | ( | ConstStringRef | label,
|  | MenuEntryOption | option )

A specific menu entry. They can be put into a Container::Vertical to form a menu.

Parameters

  label | The text drawn representing this element.
  option | Additional optional parameters.

### Example

auto screen = ScreenInteractive::TerminalOutput();
int selected = 0;
auto menu = Container::Vertical({
MenuEntry("entry 1"),
MenuEntry("entry 2"),
MenuEntry("entry 3"),
}, &selected);
screen.Loop(menu);

### Output

> entry 1
entry 2
entry 3

Definition at line 584 of file menu.cpp.

## Radiobox() [1/2]

Component Radiobox | ( | RadioboxOption | option | ) |

A list of element, where only one can be selected.

Parameters

  option | The parameters

See also
  RadioboxBase

### Example

auto screen = ScreenInteractive::TerminalOutput();
std::vector<std::string> entries = {
"entry 1",
"entry 2",
"entry 3",
};
int selected = 0;
auto menu = Radiobox({
.entries = entries,
.selected = &selected,
});
screen.Loop(menu);
ftxui::Radiobox
Component Radiobox(RadioboxOption options)
A list of element, where only one can be selected.
Definition radiobox.cpp:204

### Output

◉ entry 1
○ entry 2
○ entry 3

NOLINTNEXTLINE

Examples
  examples/component/flexbox_gallery.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/maybe.cpp, examples/component/radiobox.cpp, examples/component/radiobox_in_frame.cpp, examples/component/tab_horizontal.cpp, and examples/component/tab_vertical.cpp.

Definition at line 204 of file radiobox.cpp.

## Radiobox() [2/2]

Component Radiobox | ( | ConstStringListRef | entries,
|  | int * | selected,
|  | RadioboxOption | option )

A list of element, where only one can be selected.

Parameters

  entries | The list of entries in the list.
  selected | The index of the currently selected element.
  option | Additional optional parameters.

See also
  RadioboxBase

### Example

auto screen = ScreenInteractive::TerminalOutput();
std::vector<std::string> entries = {
"entry 1",
"entry 2",
"entry 3",
};
int selected = 0;
auto menu = Radiobox(&entries, &selected);
screen.Loop(menu);

### Output

◉ entry 1
○ entry 2
○ entry 3

Definition at line 236 of file radiobox.cpp.

## Dropdown() [1/2]

Component Dropdown | ( | ConstStringListRef | entries,
|  | int * | selected )

A dropdown menu.

Parameters

  entries | The list of entries to display.
  selected | The index of the selected entry.

Examples
  examples/component/dropdown.cpp, and examples/component/dropdown_custom.cpp.

Definition at line 22 of file dropdown.cpp.

## Dropdown() [2/2]

Component Dropdown | ( | DropdownOption | option | ) |

A dropdown menu.

Parameters

  option | The options for the dropdown.

Definition at line 33 of file dropdown.cpp.

## Toggle()

Component Toggle | ( | ConstStringListRef | entries,
|  | int * | selected )

An horizontal list of elements. The user can navigate through them.

Parameters

  entries | The list of selectable entries to display.
  selected | Reference the selected entry. See also |Menu|.

Examples
  examples/component/gallery.cpp, examples/component/tab_horizontal.cpp, and examples/component/toggle.cpp.

Definition at line 554 of file menu.cpp.

## Slider() [1/14]

template<typename T>

Component Slider | ( | SliderOption< T > | options | ) |

A slider in any direction.

Parameters

  options | The options

### Example

auto screen = ScreenInteractive::TerminalOutput();
int value = 50;
auto slider = Slider({
.value = &value,
.min = 0,
.max = 100,
.increment= 20,
});
screen.Loop(slider);
ftxui::Slider
Component Slider(SliderOption< T > options)
A slider in any direction.
Definition slider.cpp:346

Examples
  examples/component/focus.cpp, examples/component/gallery.cpp, examples/component/linear_gradient_gallery.cpp, examples/component/scrollbar.cpp, examples/component/slider.cpp, examples/component/slider_direction.cpp, examples/component/slider_rgb.cpp, and examples/component/window.cpp.

Definition at line 346 of file slider.cpp.

## Slider() [2/14]

Component Slider | ( | ConstStringRef | label,
|  | Ref< int > | value,
|  | ConstRef< int > | min,
|  | ConstRef< int > | max,
|  | ConstRef< int > | increment )

An horizontal slider.

Parameters

  label | The name of the slider.
  value | The current value of the slider.
  min | The minimum value.
  max | The maximum value.
  increment | The increment when used by the cursor.

### Example

auto screen = ScreenInteractive::TerminalOutput();
int value = 50;
auto slider = Slider("Value:", &value, 0, 100, 1);
screen.Loop(slider);

### Output

Value:[██████████████████████████ ]

Definition at line 289 of file slider.cpp.

## Slider() [3/14]

Component Slider | ( | ConstStringRef | label,
|  | Ref< float > | value,
|  | ConstRef< float > | min = 0.f,
|  | ConstRef< float > | max = 100.f,
|  | ConstRef< float > | increment = 5.f )

Definition at line 303 of file slider.cpp.

## Slider() [4/14]

Component Slider | ( | ConstStringRef | label,
|  | Ref< long > | value,
|  | ConstRef< long > | min = 0L,
|  | ConstRef< long > | max = 100L,
|  | ConstRef< long > | increment = 5L )

Definition at line 316 of file slider.cpp.

## ResizableSplit()

Component ResizableSplit | ( | ResizableSplitOption | options | ) |

A split in between two components.

Parameters

  options | all the parameters.

### Example

auto left = Renderer([] { return text("Left") | center;});
auto right = Renderer([] { return text("right") | center;});
int left_size = 10;
auto component = ResizableSplit({
.main = left,
.back = right,
.direction = Direction::Left,
.main_size = &left_size,
.separator_func = [] { return separatorDouble(); },
});
ftxui::Direction::Left
@ Left
Definition direction.hpp:11
ftxui::Renderer
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Definition renderer.cpp:61
ftxui::center
Element center(Element)
Center an element horizontally and vertically.
Definition composite_decorator.cpp:31
ftxui::ResizableSplit
Component ResizableSplit(ResizableSplitOption options)
A split in between two components.
Definition resizable_split.cpp:186
ftxui::text
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
ftxui::separatorDouble
Element separatorDouble()
Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
Definition separator.cpp:320

### Output

║
left ║ right
║

Definition at line 186 of file resizable_split.cpp.

## ResizableSplitLeft()

Component ResizableSplitLeft | ( | Component | main,
|  | Component | back,
|  | int * | main_size )

An horizontal split in between two components, configurable using the mouse.

Parameters

  main | The main component of size |main_size|, on the left.
  back | The back component taking the remaining size, on the right.
  main_size | The size of the |main| component.

### Example

auto screen = ScreenInteractive::Fullscreen();
int left_size = 10;
auto left = Renderer([] { return text("Left") | center;});
auto right = Renderer([] { return text("right") | center;});
auto split = ResizableSplitLeft(left, right, &left_size);
screen.Loop(split);
ftxui::ScreenInteractive::Fullscreen
static ScreenInteractive Fullscreen()
Definition screen_interactive.cpp:374
ftxui::ResizableSplitLeft
Component ResizableSplitLeft(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
Definition resizable_split.cpp:215

### Output

│
left │ right
│

Examples
  examples/component/homescreen.cpp, examples/component/print_key_press.cpp, examples/component/resizable_split.cpp, and examples/component/textarea.cpp.

Definition at line 215 of file resizable_split.cpp.

## ResizableSplitRight()

Component ResizableSplitRight | ( | Component | main,
|  | Component | back,
|  | int * | main_size )

An horizontal split in between two components, configurable using the mouse.

Parameters

  main | The main component of size |main_size|, on the right.
  back | The back component taking the remaining size, on the left.
  main_size | The size of the |main| component.

### Example

auto screen = ScreenInteractive::Fullscreen();
int right_size = 10;
auto left = Renderer([] { return text("Left") | center;});
auto right = Renderer([] { return text("right") | center;});
auto split = ResizableSplitRight(right, left, &right_size)
screen.Loop(split);
ftxui::ResizableSplitRight
Component ResizableSplitRight(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
Definition resizable_split.cpp:249

### Output

│
left │ right
│

Examples
  examples/component/flexbox_gallery.cpp, and examples/component/resizable_split.cpp.

Definition at line 249 of file resizable_split.cpp.

## ResizableSplitTop()

Component ResizableSplitTop | ( | Component | main,
|  | Component | back,
|  | int * | main_size )

An vertical split in between two components, configurable using the mouse.

Parameters

  main | The main component of size |main_size|, on the top.
  back | The back component taking the remaining size, on the bottom.
  main_size | The size of the |main| component.

### Example

auto screen = ScreenInteractive::Fullscreen();
int top_size = 1;
auto top = Renderer([] { return text("Top") | center;});
auto bottom = Renderer([] { return text("Bottom") | center;});
auto split = ResizableSplitTop(top, bottom, &top_size)
screen.Loop(split);
ftxui::ResizableSplitTop
Component ResizableSplitTop(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
Definition resizable_split.cpp:283

### Output

top
────────────
bottom

Examples
  examples/component/resizable_split.cpp.

Definition at line 283 of file resizable_split.cpp.

## ResizableSplitBottom()

Component ResizableSplitBottom | ( | Component | main,
|  | Component | back,
|  | int * | main_size )

An vertical split in between two components, configurable using the mouse.

Parameters

  main | The main component of size |main_size|, on the bottom.
  back | The back component taking the remaining size, on the top.
  main_size | The size of the |main| component.

### Example

auto screen = ScreenInteractive::Fullscreen();
int bottom_size = 1;
auto top = Renderer([] { return text("Top") | center;});
auto bottom = Renderer([] { return text("Bottom") | center;});
auto split = ResizableSplit::Bottom(bottom, top, &bottom_size)
screen.Loop(split);

### Output

top
────────────
bottom

Examples
  examples/component/flexbox_gallery.cpp, and examples/component/resizable_split.cpp.

Definition at line 317 of file resizable_split.cpp.

## Renderer() [1/4]

Component Renderer | ( | Component | child,
|  | std::function< Element()> | render )

Return a new Component, similar to |child|, but using |render| as the Component::Render() event.

Parameters

  child | The component to forward events to.
  render | The function drawing the interface.

### Example

auto screen = ScreenInteractive::TerminalOutput();
std::string label = "Click to quit";
auto button = Button(&label, screen.ExitLoopClosure());
auto renderer = Renderer(button, [&] {
return hbox({
text("A button:"),
button->Render(),
});
});
screen.Loop(renderer);
ftxui::hbox
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94

Examples
  examples/component/button.cpp, examples/component/button_animated.cpp, examples/component/button_in_frame.cpp, examples/component/button_style.cpp, examples/component/canvas_animated.cpp, examples/component/checkbox_in_frame.cpp, examples/component/collapsible.cpp, examples/component/composition.cpp, examples/component/custom_loop.cpp, examples/component/flexbox_gallery.cpp, examples/component/focus.cpp, examples/component/focus_cursor.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/input_in_frame.cpp, examples/component/linear_gradient_gallery.cpp, examples/component/maybe.cpp, examples/component/menu2.cpp, examples/component/menu_entries.cpp, examples/component/menu_entries_animated.cpp, examples/component/menu_in_frame.cpp, examples/component/menu_in_frame_horizontal.cpp, examples/component/menu_multiple.cpp, examples/component/menu_style.cpp, examples/component/menu_underline_animated_gallery.cpp, examples/component/modal_dialog.cpp, examples/component/modal_dialog_custom.cpp, examples/component/nested_screen.cpp, examples/component/print_key_press.cpp, examples/component/radiobox_in_frame.cpp, examples/component/renderer.cpp, examples/component/resizable_split.cpp, examples/component/scrollbar.cpp, examples/component/selection.cpp, examples/component/slider_rgb.cpp, examples/component/tab_horizontal.cpp, examples/component/tab_vertical.cpp, examples/component/textarea.cpp, examples/component/toggle.cpp, examples/component/window.cpp, and examples/component/with_restored_io.cpp.

Definition at line 61 of file renderer.cpp.

## Renderer() [2/4]

Component Renderer | ( | std::function< Element()> | render | ) |

Return a component, using |render| to render its interface.

Parameters

  render | The function drawing the interface.

### Example

auto screen = ScreenInteractive::TerminalOutput();
auto renderer = Renderer([] {
return text("My interface");
});
screen.Loop(renderer);

Definition at line 29 of file renderer.cpp.

## Renderer() [3/4]

Component Renderer | ( | std::function< Element(bool)> | render | ) |

Return a focusable component, using |render| to render its interface.

Parameters

  render | The function drawing the interface, taking a boolean telling whether the component is focused or not.

### Example

auto screen = ScreenInteractive::TerminalOutput();
auto renderer = Renderer([] (bool focused) {
if (focused)
return text("My interface") | inverted;
else
return text("My interface");
});
screen.Loop(renderer);
ftxui::inverted
Element inverted(Element)
Add a filter that will invert the foreground and the background colors.
Definition inverted.cpp:34

Definition at line 84 of file renderer.cpp.

## Renderer() [4/4]

ComponentDecorator Renderer | ( | ElementDecorator | decorator | ) |

Decorate a component, by decorating what it renders.

Parameters

  decorator | the function modifying the element it renders.

### Example

auto screen = ScreenInteractive::TerminalOutput();
auto renderer =
// Renderer([] { return text("Hello");)
| Renderer(bold)
| Renderer(inverted);
screen.Loop(renderer);
ftxui::bold
Element bold(Element)
Use a bold font, for elements with more emphasis.
Definition bold.cpp:33

Definition at line 125 of file renderer.cpp.

## CatchEvent() [1/3]

Component CatchEvent | ( | Component | child,
|  | std::function< bool(Event)> | )

Examples
  examples/component/canvas_animated.cpp, examples/component/custom_loop.cpp, examples/component/input.cpp, and examples/component/print_key_press.cpp.

## CatchEvent() [2/3]

ComponentDecorator CatchEvent | ( | std::function< bool(Event)> | on_event | ) |

Decorate a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.

Parameters

  on_event | The function drawing the interface.

### Example

auto screen = ScreenInteractive::TerminalOutput();
auto renderer = Renderer([] { return text("Hello world"); });
renderer |= CatchEvent([&](Event event) {
if (event == Event::Character('q')) {
screen.ExitLoopClosure()();
return true;
}
return false;
});
screen.Loop(renderer);
ftxui::CatchEvent
Component CatchEvent(Component child, std::function< bool(Event)>)
ftxui::Event::Character
static Event Character(std::string)
An event corresponding to a given typed character.
Definition event.cpp:29

Definition at line 80 of file catch_event.cpp.

## Maybe() [1/4]

Component Maybe | ( | Component | child,
|  | const bool * | show )

Decorate a component |child|. It is shown only when |show| is true.

Parameters

  child | the compoennt to decorate.
  show | a boolean. |child| is shown when |show| is true.

### Example

auto component = Renderer([]{ return text("Hello World!"); });
auto maybe_component = Maybe(component, &show);
ftxui::Maybe
Component Maybe(Component, const bool *show)
Decorate a component |child|. It is shown only when |show| is true.
Definition maybe.cpp:74

Examples
  examples/component/maybe.cpp.

Definition at line 74 of file maybe.cpp.

## Maybe() [2/4]

Component Maybe | ( | Component | child,
|  | std::function< bool()> | show )

Decorate a component |child|. It is shown only when |show| returns true.

Parameters

  child | the compoenent to decorate.
  show | a function returning whether |child| should shown.

Definition at line 21 of file maybe.cpp.

## Maybe() [3/4]

ComponentDecorator Maybe | ( | const bool * | show | ) |

Decorate a component. It is shown only when |show| is true.

Parameters

  show | a boolean. |child| is shown when |show| is true.

### Example

auto component = Renderer([]{ return text("Hello World!"); });
auto maybe_component = component | Maybe(&show);

Definition at line 88 of file maybe.cpp.

## Maybe() [4/4]

ComponentDecorator Maybe | ( | std::function< bool()> | show | ) |

Decorate a component. It is shown only when the |show| function returns true.

Parameters

  show | a function returning whether the decorated component should be shown.

### Example

auto component = Renderer([]{ return text("Hello World!"); });
auto maybe_component = component | Maybe([&]{ return counter == 42; });

Definition at line 57 of file maybe.cpp.

## Modal() [1/2]

Component Modal | ( | Component | main,
|  | Component | modal,
|  | const bool * | show_modal )

Examples
  examples/component/modal_dialog.cpp.

Definition at line 18 of file modal.cpp.

## Modal() [2/2]

ComponentDecorator Modal | ( | Component | modal,
|  | const bool * | show_modal )

Definition at line 58 of file modal.cpp.

## Collapsible()

Component Collapsible | ( | ConstStringRef | label,
|  | Component | child,
|  | Ref< bool > | show = false )

Examples
  examples/component/collapsible.cpp.

## Hoverable() [1/6]

Component Hoverable | ( | Component | component,
|  | bool * | hover )

Wrap a component. Gives the ability to know if it is hovered by the mouse.

Parameters

  component | The wrapped component.
  hover | The value to reflect whether the component is hovered or not.

### Example

auto button = Button("exit", screen.ExitLoopClosure());
bool hover = false;
auto button_hover = Hoverable(button, &hover);
ftxui::Hoverable
Component Hoverable(Component component, bool *hover)
Wrap a component. Gives the ability to know if it is hovered by the mouse.
Definition hoverable.cpp:43

Definition at line 43 of file hoverable.cpp.

## Hoverable() [2/6]

Component Hoverable | ( | Component | component,
|  | std::function< void()> | on_enter,
|  | std::function< void()> | on_leave )

Wrap a component. Uses callbacks.

Parameters

  component | The wrapped component.
  on_enter | Callback OnEnter
  on_leave | Callback OnLeave

### Example

auto button = Button("exit", screen.ExitLoopClosure());
bool hover = false;
auto button_hover = Hoverable(button, &hover);

Definition at line 86 of file hoverable.cpp.

## Hoverable() [3/6]

Component Hoverable | ( | Component | component,
|  | std::function< void(bool)> | on_change )

Wrap a component. Gives the ability to know if it is hovered by the mouse.

Parameters

  component | the wrapped component.
  on_change | is called when the mouse enter or leave the component.

### Example

auto button = Button("exit", screen.ExitLoopClosure());
bool hovered = false;
auto button_hoverable = Hoverable(button,
// [&](bool hover) { hovered = hover;});

Definition at line 188 of file hoverable.cpp.

## Hoverable() [4/6]

ComponentDecorator Hoverable | ( | bool * | hover | ) |

Wrap a component. Gives the ability to know if it is hovered by the mouse.

Parameters

  hover | The value to reflect whether the component is hovered or not.

### Example

bool hover = false;
auto button = Button("exit", screen.ExitLoopClosure());
button |= Hoverable(&hover);

Definition at line 141 of file hoverable.cpp.

## Hoverable() [5/6]

ComponentDecorator Hoverable | ( | std::function< void()> | on_enter,
|  | std::function< void()> | on_leave )

Wrap a component. Gives the ability to know if it is hovered by the mouse.

Parameters

  on_enter | is called when the mouse hover the component.
  on_leave | is called when the mouse leave the component.

### Example

auto button = Button("exit", screen.ExitLoopClosure());
int on_enter_cnt = 0;
int on_leave_cnt = 0;
button |= Hoverable(
[&]{ on_enter_cnt++; },
[&]{ on_leave_cnt++; }
// );

Definition at line 165 of file hoverable.cpp.

## Hoverable() [6/6]

ComponentDecorator Hoverable | ( | std::function< void(bool)> | on_change | ) |

Wrap a component. Gives the ability to know if it is hovered by the mouse.

Parameters

  on_change | is called when the mouse enter or leave the component.

### Example

auto button = Button("exit", screen.ExitLoopClosure());
bool hovered = false;
button |= Hoverable([&](bool hover) { hovered = hover;});

Definition at line 209 of file hoverable.cpp.

## Window()

Component Window | ( | WindowOptions | option | ) |

A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;.

Parameters

  option | A struct holding every parameters.

See also
  Window

### Example

auto window_1= Window({
.inner = DummyWindowContent(),
.title = "First window",
});
auto window_2= Window({
.inner = DummyWindowContent(),
.title = "Second window",
});
auto container = Container::Stacked({
window_1,
window_2,
});
ftxui::Container::Stacked
Component Stacked(Components children)
A list of components to be stacked on top of each other. Events are propagated to the first component...
Definition container.cpp:432
ftxui::Window
Component Window(WindowOptions option)
A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stac...
Definition window.cpp:312

Examples
  examples/component/menu_multiple.cpp, examples/component/scrollbar.cpp, and examples/component/window.cpp.

Definition at line 312 of file window.cpp.

## MakeReceiver()

template<class T>

Receiver< T > MakeReceiver | ( |  | ) |

Definition at line 139 of file receiver.hpp.

## text() [1/2]

Element text | ( | std::wstring | text | ) |

Display a piece of unicode text.

See also
  ftxui::to_wstring

### Example

Element document = text(L"Hello world!");
ftxui::Element
std::shared_ptr< Node > Element
Definition elements.hpp:22

### Output

Hello world!

Examples
  examples/component/button.cpp, examples/component/button_animated.cpp, examples/component/button_in_frame.cpp, examples/component/button_style.cpp, examples/component/collapsible.cpp, examples/component/composition.cpp, examples/component/custom_loop.cpp, examples/component/dropdown_custom.cpp, examples/component/flexbox_gallery.cpp, examples/component/focus.cpp, examples/component/focus_cursor.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/input_style.cpp, examples/component/linear_gradient_gallery.cpp, examples/component/maybe.cpp, examples/component/menu2.cpp, examples/component/menu_entries.cpp, examples/component/menu_entries_animated.cpp, examples/component/menu_multiple.cpp, examples/component/menu_style.cpp, examples/component/menu_underline_animated_gallery.cpp, examples/component/modal_dialog.cpp, examples/component/modal_dialog_custom.cpp, examples/component/nested_screen.cpp, examples/component/print_key_press.cpp, examples/component/renderer.cpp, examples/component/resizable_split.cpp, examples/component/scrollbar.cpp, examples/component/selection.cpp, examples/component/slider_rgb.cpp, examples/component/textarea.cpp, examples/component/toggle.cpp, examples/component/window.cpp, examples/dom/border.cpp, examples/dom/border_colored.cpp, examples/dom/border_style.cpp, examples/dom/color_gallery.cpp, examples/dom/color_info_palette256.cpp, examples/dom/color_truecolor_HSV.cpp, examples/dom/color_truecolor_RGB.cpp, examples/dom/dbox.cpp, examples/dom/gauge.cpp, examples/dom/gauge_direction.cpp, examples/dom/gridbox.cpp, examples/dom/hflow.cpp, examples/dom/html_like.cpp, examples/dom/linear_gradient.cpp, examples/dom/package_manager.cpp, examples/dom/separator.cpp, examples/dom/separator_style.cpp, examples/dom/size.cpp, examples/dom/spinner.cpp, examples/dom/style_blink.cpp, examples/dom/style_bold.cpp, examples/dom/style_color.cpp, examples/dom/style_dim.cpp, examples/dom/style_gallery.cpp, examples/dom/style_hyperlink.cpp, examples/dom/style_inverted.cpp, examples/dom/style_italic.cpp, examples/dom/style_strikethrough.cpp, examples/dom/style_underlined.cpp, examples/dom/style_underlined_double.cpp, examples/dom/vbox_hbox.cpp, and examples/dom/vflow.cpp.

Definition at line 160 of file text.cpp.

## vtext() [1/2]

Element vtext | ( | std::wstring | text | ) |

Display a piece unicode text vertically.

See also
  ftxui::to_wstring

### Example

Element document = vtext(L"Hello world!");
ftxui::vtext
Element vtext(std::wstring text)
Display a piece unicode text vertically.
Definition text.cpp:220

### Output

H
e
l
l
o
w
o
r
l
d
!

Examples
  examples/dom/gauge_direction.cpp.

Definition at line 220 of file text.cpp.

## paragraph() [1/2]

Elements paragraph | ( | std::wstring | text | ) |

Examples
  examples/component/homescreen.cpp, examples/component/selection.cpp, examples/component/with_restored_io.cpp, examples/dom/html_like.cpp, and examples/dom/paragraph.cpp.

## operator|() [3/5]

Element operator| | ( | Element | element,
|  | Decorator | decorator )

From an element, apply a decorator.

Returns
  the decorated element.

### Example

Both of these are equivalent:

bold(text("Hello"));
text("Hello") | bold;

Definition at line 70 of file util.cpp.

## operator|=() [3/3]

Element & operator|= | ( | Element & | e,
|  | Decorator | d )

Apply a decorator to an element.

Returns
  the decorated element.

### Example

Both of these are equivalent:

auto element = text("Hello");
element |= bold;

Definition at line 85 of file util.cpp.

## operator|() [4/5]

Elements operator| | ( | Elements | elements,
|  | Decorator | decorator )

From a set of element, apply a decorator to every elements.

Returns
  the set of decorated element.

Definition at line 48 of file util.cpp.

## operator|() [5/5]

Decorator operator| | ( | Decorator | a,
|  | Decorator | b )

Compose two decorator into one.

### Example

auto decorator = bold | blink;
ftxui::blink
Element blink(Element)
The text drawn alternates in between visible and hidden.
Definition blink.cpp:33

Definition at line 40 of file util.cpp.

## text() [2/2]

Element text | ( | std::string | text | ) |

Display a piece of UTF8 encoded unicode text.

See also
  ftxui::to_wstring

### Example

Element document = text("Hello world!");

### Output

Hello world!

Definition at line 141 of file text.cpp.

## vtext() [2/2]

Element vtext | ( | std::string | text | ) |

Display a piece of unicode text vertically.

See also
  ftxui::to_wstring

### Example

Element document = vtext("Hello world!");

### Output

H
e
l
l
o
w
o
r
l
d
!

Definition at line 190 of file text.cpp.

## separator() [1/2]

Element separator | ( |  | ) |

Draw a vertical or horizontal separation in between two other elements.

See also
  separator
  separatorLight
  separatorDashed
  separatorDouble
  separatorHeavy
  separatorEmpty
  separatorRounded
  separatorStyled
  separatorCharacter

Add a visual separation in between two elements.

### Example

// Use 'border' as a function...
Element document = vbox({
text("up"),
separator(),
text("down"),
});
ftxui::separator
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Definition separator.cpp:134
ftxui::vbox
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96

### Output

up
────
down

Examples
  examples/component/button_animated.cpp, examples/component/button_in_frame.cpp, examples/component/button_style.cpp, examples/component/canvas_animated.cpp, examples/component/composition.cpp, examples/component/custom_loop.cpp, examples/component/focus.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/input_style.cpp, examples/component/menu2.cpp, examples/component/menu_entries.cpp, examples/component/menu_entries_animated.cpp, examples/component/menu_style.cpp, examples/component/modal_dialog.cpp, examples/component/modal_dialog_custom.cpp, examples/component/nested_screen.cpp, examples/component/print_key_press.cpp, examples/component/selection.cpp, examples/component/slider_rgb.cpp, examples/component/tab_horizontal.cpp, examples/component/tab_vertical.cpp, examples/component/textarea.cpp, examples/dom/border_colored.cpp, examples/dom/color_gallery.cpp, examples/dom/gauge_direction.cpp, examples/dom/graph.cpp, examples/dom/package_manager.cpp, examples/dom/paragraph.cpp, examples/dom/separator.cpp, and examples/dom/spinner.cpp.

Definition at line 134 of file separator.cpp.

## separatorLight()

Element separatorLight | ( |  | ) |

Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.

See also
  separator
  separatorLight
  separatorDashed
  separatorDouble
  separatorHeavy
  separatorEmpty
  separatorRounded
  separatorStyled
  separatorCharacter

Add a visual separation in between two elements.

### Example

// Use 'border' as a function...
Element document = vbox({
text("up"),
separatorLight(),
text("down"),
});
ftxui::separatorLight
Element separatorLight()
Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
Definition separator.cpp:209

### Output

up
────
down

Examples
  examples/dom/separator_style.cpp.

Definition at line 209 of file separator.cpp.

## separatorDashed()

Element separatorDashed | ( |  | ) |

Draw a vertical or horizontal separation in between two other elements, using the DASHED style.

See also
  separator
  separatorLight
  separatorDashed
  separatorDouble
  separatorHeavy
  separatorEmpty
  separatorRounded
  separatorStyled
  separatorCharacter

Add a visual separation in between two elements.

### Example

// Use 'border' as a function...
Element document = vbox({
text("up"),
separatorLight(),
text("down"),
});

### Output

up
╍╍╍╍
down

Examples
  examples/dom/separator_style.cpp.

Definition at line 246 of file separator.cpp.

## separatorHeavy()

Element separatorHeavy | ( |  | ) |

Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.

See also
  separator
  separatorLight
  separatorDashed
  separatorDouble
  separatorHeavy
  separatorEmpty
  separatorRounded
  separatorStyled
  separatorCharacter

Add a visual separation in between two elements.

### Example

// Use 'border' as a function...
Element document = vbox({
text("up"),
separatorHeavy(),
text("down"),
});
ftxui::separatorHeavy
Element separatorHeavy()
Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
Definition separator.cpp:283

### Output

up
━━━━
down

Examples
  examples/dom/separator_style.cpp.

Definition at line 283 of file separator.cpp.

## separatorDouble()

Element separatorDouble | ( |  | ) |

Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.

See also
  separator
  separatorLight
  separatorDashed
  separatorDouble
  separatorHeavy
  separatorEmpty
  separatorRounded
  separatorStyled
  separatorCharacter

Add a visual separation in between two elements.

### Example

// Use 'border' as a function...
Element document = vbox({
text("up"),
separatorDouble(),
text("down"),
});

### Output

up
════
down

Examples
  examples/dom/separator_style.cpp.

Definition at line 320 of file separator.cpp.

## separatorEmpty()

Element separatorEmpty | ( |  | ) |

Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.

See also
  separator
  separatorLight
  separatorDashed
  separatorDouble
  separatorHeavy
  separatorEmpty
  separatorRounded
  separatorStyled
  separatorCharacter

Add a visual separation in between two elements.

### Example

// Use 'border' as a function...
Element document = vbox({
text("up"),
separator(),
text("down"),
});

### Output

up
down

Examples
  examples/component/input_style.cpp.

Definition at line 357 of file separator.cpp.

## separatorStyled()

Element separatorStyled | ( | BorderStyle | style | ) |

Draw a vertical or horizontal separation in between two other elements.

Parameters

  style | the style of the separator.

See also
  separator
  separatorLight
  separatorDashed
  separatorDouble
  separatorHeavy
  separatorEmpty
  separatorRounded
  separatorStyled
  separatorCharacter

Add a visual separation in between two elements.

### Example

// Use 'border' as a function...
Element document = vbox({
text("up"),
separatorStyled(DOUBLE),
text("down"),
});
ftxui::separatorStyled
Element separatorStyled(BorderStyle)
Draw a vertical or horizontal separation in between two other elements.
Definition separator.cpp:172
ftxui::DOUBLE
@ DOUBLE
Definition elements.hpp:31

### Output

up
════
down

Definition at line 172 of file separator.cpp.

## separator() [2/2]

Element separator | ( | Pixel | pixel | ) |

Draw a separator in between two element filled with a given pixel.

See also
  separator
  separatorLight
  separatorDashed
  separatorHeavy
  separatorDouble
  separatorStyled

### Example

Pixel empty;
Element document = vbox({
text("Up"),
separator(empty),
text("Down"),
})
ftxui::Pixel
A Unicode character and its associated style.
Definition pixel.hpp:15

### Output

Up
Down

Definition at line 426 of file separator.cpp.

## separatorCharacter()

Element separatorCharacter | ( | std::string | value | ) |

Draw a vertical or horizontal separation in between two other elements.

Parameters

  value | the character to fill the separator area.

See also
  separator
  separatorLight
  separatorDashed
  separatorDouble
  separatorHeavy
  separatorEmpty
  separatorRounded
  separatorStyled
  separatorCharacter

Add a visual separation in between two elements.

### Example

// Use 'border' as a function...
Element document = vbox({
text("up"),
separator(),
text("down"),
});

### Output

up
────
down

Definition at line 395 of file separator.cpp.

## separatorHSelector()

Element separatorHSelector | ( | float | left,
|  | float | right,
|  | Color | unselected_color,
|  | Color | selected_color )

Draw an horizontal bar, with the area in between left/right colored differently.

Parameters

  left | the left limit of the active area.
  right | the right limit of the active area.
  selected_color | the color of the selected area.
  unselected_color | the color of the unselected area.

### Example

Element document = separatorHSelector(2,5, Color::White, Color::Blue);
ftxui::Color::White
@ White
Definition color.hpp:67
ftxui::Color::Blue
@ Blue
Definition color.hpp:56
ftxui::separatorHSelector
Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
Draw an horizontal bar, with the area in between left/right colored differently.
Definition separator.cpp:442

Definition at line 442 of file separator.cpp.

## separatorVSelector()

Element separatorVSelector | ( | float | up,
|  | float | down,
|  | Color | unselected_color,
|  | Color | selected_color )

Draw an vertical bar, with the area in between up/downcolored differently.

Parameters

  up | the left limit of the active area.
  down | the right limit of the active area.
  selected_color | the color of the selected area.
  unselected_color | the color of the unselected area.

### Example

Element document = separatorHSelector(2,5, Color::White, Color::Blue);

Definition at line 512 of file separator.cpp.

## gauge()

Element gauge | ( | float | progress | ) |

Draw a high definition progress bar.

Parameters

  progress | The proportion of the area to be filled. Belong to [0,1].

### Example

A gauge. It can be used to represent a progress bar.

border(gauge(0.5))
ftxui::gauge
Element gauge(float progress)
Draw a high definition progress bar.
Definition gauge.cpp:293
ftxui::border
Element border(Element)
Draw a border around the element.
Definition border.cpp:227

#### Output

┌──────────────────────────────────────────────────────────────────────────┐
│█████████████████████████████████████ │
└──────────────────────────────────────────────────────────────────────────┘

Examples
  examples/component/button_animated.cpp, examples/component/homescreen.cpp, examples/component/menu2.cpp, examples/dom/gauge.cpp, and examples/dom/package_manager.cpp.

Definition at line 293 of file gauge.cpp.

## gaugeLeft()

Element gaugeLeft | ( | float | progress | ) |

Draw a high definition progress bar progressing from right to left.

Parameters

  progress | The proportion of the area to be filled. Belong to [0,1].

### Example

A gauge. It can be used to represent a progress bar.

border(gaugeLeft(0.5))
ftxui::gaugeLeft
Element gaugeLeft(float progress)
Draw a high definition progress bar progressing from right to left.
Definition gauge.cpp:213

#### Output

┌──────────────────────────────────────────────────────────────────────────┐
│ █████████████████████████████████████│
└──────────────────────────────────────────────────────────────────────────┘

Examples
  examples/dom/gauge_direction.cpp.

Definition at line 213 of file gauge.cpp.

## gaugeRight()

Element gaugeRight | ( | float | progress | ) |

Draw a high definition progress bar progressing from left to right.

Parameters

  progress | The proportion of the area to be filled. Belong to [0,1].

### Example

A gauge. It can be used to represent a progress bar.

border(gaugeRight(0.5))
ftxui::gaugeRight
Element gaugeRight(float progress)
Draw a high definition progress bar progressing from left to right.
Definition gauge.cpp:191

#### Output

┌──────────────────────────────────────────────────────────────────────────┐
│█████████████████████████████████████ │
└──────────────────────────────────────────────────────────────────────────┘

Examples
  examples/dom/gauge_direction.cpp.

Definition at line 191 of file gauge.cpp.

## gaugeUp()

Element gaugeUp | ( | float | progress | ) |

Draw a high definition progress bar progressing from bottom to top.

Parameters

  progress | The proportion of the area to be filled. Belong to [0,1].

### Example

A gauge. It can be used to represent a progress bar.

border(gaugeUp(0.5))
ftxui::gaugeUp
Element gaugeUp(float progress)
Draw a high definition progress bar progressing from bottom to top.
Definition gauge.cpp:242

#### Output

┌─┐
│ │
│ │
│ │
│ │
│█│
│█│
│█│
│█│
└─┘

Examples
  examples/dom/gauge_direction.cpp.

Definition at line 242 of file gauge.cpp.

## gaugeDown()

Element gaugeDown | ( | float | progress | ) |

Draw a high definition progress bar progressing from top to bottom.

Parameters

  progress | The proportion of the area to be filled. Belong to [0,1].

### Example

A gauge. It can be used to represent a progress bar.

border(gaugeDown(0.5))
ftxui::gaugeDown
Element gaugeDown(float progress)
Draw a high definition progress bar progressing from top to bottom.
Definition gauge.cpp:271

#### Output

┌─┐
│█│
│█│
│█│
│█│
│ │
│ │
│ │
│ │
└─┘

Examples
  examples/dom/gauge_direction.cpp.

Definition at line 271 of file gauge.cpp.

## gaugeDirection()

Element gaugeDirection | ( | float | progress,
|  | Direction | direction )

Draw a high definition progress bar progressing in specified direction.

Parameters

  progress | The proportion of the area to be filled. Belong to [0,1].

Definition at line 169 of file gauge.cpp.

## border()

Element border | ( | Element | child | ) |

Draw a border around the element.

See also
  border
  borderLight
  borderDashed
  borderDouble
  borderHeavy
  borderEmpty
  borderRounded
  borderStyled
  borderWith

Add a border around an element

### Example

// Use 'border' as a function...
Element document = border(text("The element"));
// ...Or as a 'pipe'.
Element document = text("The element") | border;

### Output

┌───────────┐
│The element│
└───────────┘

Examples
  examples/component/button_animated.cpp, examples/component/button_in_frame.cpp, examples/component/button_style.cpp, examples/component/canvas_animated.cpp, examples/component/checkbox_in_frame.cpp, examples/component/composition.cpp, examples/component/custom_loop.cpp, examples/component/flexbox_gallery.cpp, examples/component/focus.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/input_in_frame.cpp, examples/component/input_style.cpp, examples/component/maybe.cpp, examples/component/menu2.cpp, examples/component/menu_entries.cpp, examples/component/menu_entries_animated.cpp, examples/component/menu_in_frame.cpp, examples/component/menu_style.cpp, examples/component/modal_dialog.cpp, examples/component/modal_dialog_custom.cpp, examples/component/nested_screen.cpp, examples/component/print_key_press.cpp, examples/component/radiobox_in_frame.cpp, examples/component/renderer.cpp, examples/component/resizable_split.cpp, examples/component/selection.cpp, examples/component/slider_rgb.cpp, examples/component/tab_horizontal.cpp, examples/component/tab_vertical.cpp, examples/component/textarea.cpp, examples/component/with_restored_io.cpp, examples/dom/border.cpp, examples/dom/canvas.cpp, examples/dom/color_gallery.cpp, examples/dom/dbox.cpp, examples/dom/gauge_direction.cpp, examples/dom/graph.cpp, examples/dom/gridbox.cpp, examples/dom/hflow.cpp, examples/dom/html_like.cpp, examples/dom/paragraph.cpp, examples/dom/separator.cpp, examples/dom/spinner.cpp, and examples/dom/vflow.cpp.

Definition at line 227 of file border.cpp.

## borderLight()

Element borderLight | ( | Element | child | ) |

Draw a light border around the element.

See also
  border
  borderLight
  borderDashed
  borderDouble
  borderHeavy
  borderRounded
  borderEmpty
  borderStyled
  borderWith

Add a border around an element

### Example

// Use 'borderLight' as a function...
Element document = borderLight(text("The element"));
// ...Or as a 'pipe'.
Element document = text("The element") | borderLight;
ftxui::borderLight
Element borderLight(Element)
Draw a light border around the element.
Definition border.cpp:335

### Output

┌──────────────┐
│The element │
└──────────────┘

Examples
  examples/dom/border_style.cpp, and examples/dom/separator_style.cpp.

Definition at line 335 of file border.cpp.

## borderDashed()

Element borderDashed | ( | Element | child | ) |

Draw a dashed border around the element.

See also
  border
  borderLight
  borderDashed
  borderDouble
  borderHeavy
  borderRounded
  borderEmpty
  borderStyled
  borderWith

Add a border around an element

### Example

// Use 'borderDash' as a function...
Element document = borderDash(text("The element"));
// ...Or as a 'pipe'.
Element document = text("The element") | borderDAsh;

### Output

┏╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓
╏The element ╏
┗╍╍╍╍╍╍╍╍╍╍╍╍╍╍┛

Examples
  examples/dom/border_style.cpp, and examples/dom/separator_style.cpp.

Definition at line 300 of file border.cpp.

## borderHeavy()

Element borderHeavy | ( | Element | child | ) |

Draw a heavy border around the element.

See also
  border
  borderLight
  borderDashed
  borderDouble
  borderHeavy
  borderRounded
  borderEmpty
  borderStyled
  borderWith

Add a border around an element

### Example

// Use 'borderHeavy' as a function...
Element document = borderHeavy(text("The element"));
// ...Or as a 'pipe'.
Element document = text("The element") | borderHeavy;
ftxui::borderHeavy
Element borderHeavy(Element)
Draw a heavy border around the element.
Definition border.cpp:370

### Output

┏━━━━━━━━━━━━━━┓
┃The element ┃
┗━━━━━━━━━━━━━━┛

Examples
  examples/dom/border_style.cpp, and examples/dom/separator_style.cpp.

Definition at line 370 of file border.cpp.

## borderDouble()

Element borderDouble | ( | Element | child | ) |

Draw a double border around the element.

See also
  border
  borderLight
  borderDashed
  borderDouble
  borderHeavy
  borderRounded
  borderEmpty
  borderStyled
  borderWith

Add a border around an element

### Example

// Use 'borderDouble' as a function...
Element document = borderDouble(text("The element"));
// ...Or as a 'pipe'.
Element document = text("The element") | borderDouble;
ftxui::borderDouble
Element borderDouble(Element)
Draw a double border around the element.
Definition border.cpp:405

### Output

╔══════════════╗
║The element ║
╚══════════════╝

Examples
  examples/component/input_style.cpp, examples/component/menu_style.cpp, examples/dom/border_style.cpp, and examples/dom/separator_style.cpp.

Definition at line 405 of file border.cpp.

## borderRounded()

Element borderRounded | ( | Element | child | ) |

Draw a rounded border around the element.

See also
  border
  borderLight
  borderDashed
  borderDouble
  borderHeavy
  borderRounded
  borderEmpty
  borderStyled
  borderWith

Add a border around an element

### Example

// Use 'borderRounded' as a function...
Element document = borderRounded(text("The element"));
// ...Or as a 'pipe'.
Element document = text("The element") | borderRounded;
ftxui::borderRounded
Element borderRounded(Element)
Draw a rounded border around the element.
Definition border.cpp:440

### Output

╭──────────────╮
│The element │
╰──────────────╯

Examples
  examples/component/input_style.cpp, and examples/dom/border_style.cpp.

Definition at line 440 of file border.cpp.

## borderEmpty()

Element borderEmpty | ( | Element | child | ) |

Draw an empty border around the element.

See also
  border
  borderLight
  borderDashed
  borderDouble
  borderHeavy
  borderRounded
  borderEmpty
  borderStyled
  borderWith

Add a border around an element

### Example

// Use 'borderRounded' as a function...
Element document = borderRounded(text("The element"));
// ...Or as a 'pipe'.
Element document = text("The element") | borderRounded;

### Output

The element

Examples
  examples/component/dropdown_custom.cpp, examples/component/input_style.cpp, examples/component/menu_underline_animated_gallery.cpp, and examples/component/with_restored_io.cpp.

Definition at line 475 of file border.cpp.

## borderStyled() [1/3]

Decorator borderStyled | ( | BorderStyle | style | ) |

Same as border but with different styles.

See also
  border

Examples
  examples/dom/border_colored.cpp.

Definition at line 243 of file border.cpp.

## borderStyled() [2/3]

Decorator borderStyled | ( | BorderStyle | style,
|  | Color | foreground_color )

Same as border but with a foreground color and a different style.

See also
  border

Definition at line 262 of file border.cpp.

## borderStyled() [3/3]

Decorator borderStyled | ( | Color | foreground_color | ) |

Same as border but with a foreground color.

See also
  border

Definition at line 252 of file border.cpp.

## borderWith()

Decorator borderWith | ( | const Pixel & | pixel | ) |

Same as border but with a constant Pixel around the element.

See also
  border

Definition at line 234 of file border.cpp.

## window()

Element window | ( | Element | title,
|  | Element | content,
|  | BorderStyle | border )

Draw window with a title and a border around the element.

Parameters

  title | The title of the window.
  content | The element to be wrapped.
  border | The style of the border. Default is ROUNDED.

See also
  border

### Example

Element document = window(text("Title"),
text("content")
);
// With specifying border
Element document = window(text("Title"),
text("content"),
ROUNDED
);
ftxui::window
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Draw window with a title and a border around the element.
Definition border.cpp:507
ftxui::ROUNDED
@ ROUNDED
Definition elements.hpp:32

### Output

┌Title──┐
│content│
└───────┘

Examples
  examples/component/flexbox_gallery.cpp, examples/component/homescreen.cpp, examples/component/menu_multiple.cpp, examples/component/selection.cpp, examples/dom/color_truecolor_RGB.cpp, examples/dom/hflow.cpp, examples/dom/package_manager.cpp, examples/dom/size.cpp, and examples/dom/vflow.cpp.

Definition at line 507 of file border.cpp.

## spinner()

Element spinner | ( | int | charset_index,
|  | size_t | image_index )

Useful to represent the effect of time and/or events. This display an ASCII art "video".

Parameters

  charset_index | The type of "video".
  image_index | The "frame" of the video. You need to increase this for every "step".

Examples
  examples/component/homescreen.cpp, examples/dom/html_like.cpp, and examples/dom/spinner.cpp.

Definition at line 282 of file spinner.cpp.

## paragraph() [2/2]

Element paragraph | ( | const std::string & | the_text | ) |

Return an element drawing the paragraph on multiple lines.

See also
  flexbox.

Definition at line 41 of file paragraph.cpp.

## paragraphAlignLeft()

Element paragraphAlignLeft | ( | const std::string & | the_text | ) |

Return an element drawing the paragraph on multiple lines, aligned on the left.

See also
  flexbox.

Examples
  examples/component/homescreen.cpp.

Definition at line 49 of file paragraph.cpp.

## paragraphAlignRight()

Element paragraphAlignRight | ( | const std::string & | the_text | ) |

Return an element drawing the paragraph on multiple lines, aligned on the right.

See also
  flexbox.

Examples
  examples/component/homescreen.cpp.

Definition at line 60 of file paragraph.cpp.

## paragraphAlignCenter()

Element paragraphAlignCenter | ( | const std::string & | the_text | ) |

Return an element drawing the paragraph on multiple lines, aligned on the center.

See also
  flexbox.

Examples
  examples/component/homescreen.cpp.

Definition at line 72 of file paragraph.cpp.

## paragraphAlignJustify()

Element paragraphAlignJustify | ( | const std::string & | the_text | ) |

Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center.

See also
  flexbox.

Examples
  examples/component/homescreen.cpp.

Definition at line 85 of file paragraph.cpp.

## graph()

Element graph | ( | GraphFunction | graph_function | ) |

Draw a graph using a GraphFunction.

Parameters

  graph_function | the function to be called to get the data.

Examples
  examples/component/homescreen.cpp, and examples/dom/graph.cpp.

Definition at line 71 of file graph.cpp.

## emptyElement()

Element emptyElement | ( |  | ) |

An element of size 0x0 drawing nothing.

Definition at line 140 of file util.cpp.

## canvas() [1/3]

Element canvas | ( | ConstRef< Canvas > | canvas | ) |

Produce an element from a Canvas, or a reference to a Canvas.

Examples
  examples/component/canvas_animated.cpp, and examples/dom/canvas.cpp.

Definition at line 891 of file canvas.cpp.

## canvas() [2/3]

Element canvas | ( | int | width,
|  | int | height,
|  | std::function< void(Canvas &)> | fn )

Produce an element drawing a canvas of requested size.

Parameters

  width | the width of the canvas.
  height | the height of the canvas.
  fn | a function drawing the canvas.

Definition at line 908 of file canvas.cpp.

## canvas() [3/3]

Element canvas | ( | std::function< void(Canvas &)> | fn | ) |

Produce an element drawing a canvas.

Parameters

  fn | a function drawing the canvas.

Definition at line 938 of file canvas.cpp.

## bold()

Element bold | ( | Element | child | ) |

Use a bold font, for elements with more emphasis.

Examples
  examples/component/dropdown_custom.cpp, examples/component/flexbox_gallery.cpp, examples/component/homescreen.cpp, examples/component/menu2.cpp, examples/component/menu_entries.cpp, examples/component/menu_style.cpp, examples/component/modal_dialog_custom.cpp, examples/component/renderer.cpp, examples/dom/hflow.cpp, examples/dom/html_like.cpp, examples/dom/package_manager.cpp, examples/dom/size.cpp, examples/dom/spinner.cpp, examples/dom/style_bold.cpp, examples/dom/style_gallery.cpp, examples/dom/table.cpp, and examples/dom/vflow.cpp.

Definition at line 33 of file bold.cpp.

## dim()

Element dim | ( | Element | child | ) |

Use a light font, for elements with less emphasis.

Examples
  examples/component/flexbox_gallery.cpp, examples/component/homescreen.cpp, examples/component/input_style.cpp, examples/component/menu_style.cpp, examples/dom/hflow.cpp, examples/dom/html_like.cpp, examples/dom/package_manager.cpp, examples/dom/size.cpp, examples/dom/style_dim.cpp, examples/dom/style_gallery.cpp, and examples/dom/vflow.cpp.

Definition at line 33 of file dim.cpp.

## italic()

Element italic | ( | Element | child | ) |

Apply a underlinedDouble to text.

Examples
  examples/dom/style_gallery.cpp, and examples/dom/style_italic.cpp.

Definition at line 17 of file italic.cpp.

## inverted()

Element inverted | ( | Element | child | ) |

Add a filter that will invert the foreground and the background colors.

Examples
  examples/component/dropdown_custom.cpp, examples/component/menu_entries.cpp, examples/component/menu_underline_animated_gallery.cpp, examples/dom/graph.cpp, examples/dom/style_gallery.cpp, and examples/dom/style_inverted.cpp.

Definition at line 34 of file inverted.cpp.

## underlined()

Element underlined | ( | Element | child | ) |

Make the underlined element to be underlined.

Examples
  examples/dom/html_like.cpp, examples/dom/style_gallery.cpp, and examples/dom/style_underlined.cpp.

Definition at line 33 of file underlined.cpp.

## underlinedDouble()

Element underlinedDouble | ( | Element | child | ) |

Apply a underlinedDouble to text.

Examples
  examples/dom/style_gallery.cpp, and examples/dom/style_underlined_double.cpp.

Definition at line 17 of file underlined_double.cpp.

## blink()

Element blink | ( | Element | child | ) |

The text drawn alternates in between visible and hidden.

Examples
  examples/dom/style_blink.cpp, and examples/dom/style_gallery.cpp.

Definition at line 33 of file blink.cpp.

## strikethrough()

Element strikethrough | ( | Element | child | ) |

Apply a strikethrough to text.

Examples
  examples/dom/style_gallery.cpp, and examples/dom/style_strikethrough.cpp.

Definition at line 17 of file strikethrough.cpp.

## color() [1/4]

Decorator color | ( | Color | c | ) |

Decorate using a foreground color.

Parameters

  c | The foreground color to be applied.

Returns
  The Decorator applying the color.

### Example

Element document = text("red") | color(Color::Red);
ftxui::Color::Red
@ Red
Definition color.hpp:53
ftxui::color
Decorator color(Color)
Decorate using a foreground color.
Definition color.cpp:110

Examples
  examples/component/flexbox_gallery.cpp, examples/component/homescreen.cpp, examples/component/input_style.cpp, examples/component/maybe.cpp, examples/component/menu_entries.cpp, examples/component/menu_style.cpp, examples/component/renderer.cpp, examples/dom/border_colored.cpp, examples/dom/color_gallery.cpp, examples/dom/color_truecolor_HSV.cpp, examples/dom/graph.cpp, examples/dom/html_like.cpp, examples/dom/package_manager.cpp, examples/dom/style_color.cpp, examples/dom/style_gallery.cpp, and examples/dom/table.cpp.

Definition at line 110 of file color.cpp.

## bgcolor() [1/4]

Decorator bgcolor | ( | Color | color | ) |

Decorate using a background color.

Parameters

  color | The background color to be applied.

Returns
  The Decorator applying the color.

### Example

Element document = text("red") | bgcolor(Color::Red);
ftxui::bgcolor
Decorator bgcolor(Color)
Decorate using a background color.
Definition color.cpp:124

Examples
  examples/component/dropdown_custom.cpp, examples/component/flexbox_gallery.cpp, examples/component/focus.cpp, examples/component/homescreen.cpp, examples/component/input_style.cpp, examples/component/linear_gradient_gallery.cpp, examples/component/menu_entries_animated.cpp, examples/component/menu_style.cpp, examples/component/slider_rgb.cpp, examples/dom/color_gallery.cpp, examples/dom/color_info_palette256.cpp, examples/dom/color_truecolor_HSV.cpp, examples/dom/color_truecolor_RGB.cpp, examples/dom/linear_gradient.cpp, examples/dom/style_color.cpp, and examples/dom/style_gallery.cpp.

Definition at line 124 of file color.cpp.

## color() [2/4]

Decorator color | ( | const LinearGradient & | gradient | ) |

Decorate using a linear-gradient effect on the foreground color.

Parameters

  gradient | The gradient effect to be applied on the output element.

Returns
  The Decorator applying the color.

### Example

text("Hello") | color(LinearGradient{0, {Color::Red, Color::Blue}})
ftxui::LinearGradient
A class representing the settings for linear-gradient color effect.
Definition linear_gradient.hpp:30

Definition at line 282 of file linear_gradient.cpp.

## bgcolor() [2/4]

Decorator bgcolor | ( | const LinearGradient & | gradient | ) |

Decorate using a linear-gradient effect on the background color.

Parameters

  gradient | The gradient effect to be applied on the output element.

Returns
  The Decorator applying the color.

### Example

text("Hello") | color(LinearGradient{0, {Color::Red, Color::Blue}})

Definition at line 297 of file linear_gradient.cpp.

## color() [3/4]

Element color | ( | Color | color,
|  | Element | child )

Set the foreground color of an element.

Parameters

  color | The color of the output element.
  child | The input element.

Returns
  The output element colored.

### Example

Element document = color(Color::Green, text("Success")),
ftxui::Color::Green
@ Green
Definition color.hpp:54

Definition at line 81 of file color.cpp.

## bgcolor() [3/4]

Element bgcolor | ( | Color | color,
|  | Element | child )

Set the background color of an element.

Parameters

  color | The color of the output element.
  child | The input element.

Returns
  The output element colored.

### Example

Element document = bgcolor(Color::Green, text("Success")),

Definition at line 96 of file color.cpp.

## color() [4/4]

Element color | ( | const LinearGradient & | gradient,
|  | Element | child )

Set the foreground color of an element with linear-gradient effect.

Parameters

  gradient | The gradient effect to be applied on the output element.
  child | The input element.

Returns
  The output element colored.

### Example

color(LinearGradient{0, {Color::Red, Color::Blue}}, text("Hello"))

Definition at line 251 of file linear_gradient.cpp.

## bgcolor() [4/4]

Element bgcolor | ( | const LinearGradient & | gradient,
|  | Element | child )

Set the background color of an element with linear-gradient effect.

Parameters

  gradient | The gradient effect to be applied on the output element.
  child | The input element.

Returns
  The output element colored.

### Example

bgcolor(LinearGradient{0, {Color::Red, Color::Blue}}, text("Hello"))

Definition at line 267 of file linear_gradient.cpp.

## focusPosition()

Decorator focusPosition | ( | int | x,
|  | int | y )

Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in the numbers of cells.

### Example

Element document = huge_document()
| focusPosition(10, 10)
| frame;
ftxui::focusPosition
Decorator focusPosition(int x, int y)
Used inside a frame, this force the view to be scrolled toward a a given position....
Definition focus.cpp:69
ftxui::frame
Element frame(Element)
Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
Definition frame.cpp:118

Definition at line 69 of file focus.cpp.

## focusPositionRelative()

Decorator focusPositionRelative | ( | float | x,
|  | float | y )

Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in proportion of the requested size.

For instance:

- (0, 0) means that the view is scrolled toward the upper left.
- (1, 0) means that the view is scrolled toward the upper right.
- (0, 1) means that the view is scrolled toward the bottom left.

### Example

Element document = huge_document()
| focusPositionRelative(0.f, 1.f)
| frame;
ftxui::focusPositionRelative
Decorator focusPositionRelative(float x, float y)
Used inside a frame, this force the view to be scrolled toward a a given position....
Definition focus.cpp:31

Examples
  examples/component/focus.cpp, and examples/component/scrollbar.cpp.

Definition at line 31 of file focus.cpp.

## automerge()

Element automerge | ( | Element | child | ) |

Enable character to be automatically merged with others nearby.

Definition at line 17 of file automerge.cpp.

## hyperlink() [1/2]

Decorator hyperlink | ( | std::string | link | ) |

Decorate using an hyperlink. The link will be opened when the user click on it. This is supported only on a limited set of terminal emulator. List: https://github.com/Alhadis/OSC8-Adoption/.

Parameters

  link | The link to redirect the users to.

Returns
  The Decorator applying the hyperlink.

### Example

Element document =
text("red") | hyperlink("https://github.com/Arthursonzogni/FTXUI");
ftxui::hyperlink
Decorator hyperlink(std::string link)
Decorate using an hyperlink. The link will be opened when the user click on it. This is supported onl...
Definition hyperlink.cpp:70

Examples
  examples/dom/style_gallery.cpp, and examples/dom/style_hyperlink.cpp.

Definition at line 70 of file hyperlink.cpp.

## hyperlink() [2/2]

Element hyperlink | ( | std::string | link,
|  | Element | child )

Make the rendered area clickable using a web browser. The link will be opened when the user click on it. This is supported only on a limited set of terminal emulator. List: https://github.com/Alhadis/OSC8-Adoption/.

Parameters

  link | The link
  child | The input element.

Returns
  The output element with the link.

### Example

Element document =
hyperlink("https://github.com/ArthurSonzogni/FTXUI", "link");

Definition at line 51 of file hyperlink.cpp.

## selectionStyleReset()

Element selectionStyleReset | ( | Element | child | ) |

Reset the selection style of an element.

Parameters

  child | The input element.

Returns
  The output element with the selection style reset.

Examples
  examples/component/selection.cpp.

Definition at line 55 of file selection_style.cpp.

## selectionColor()

Decorator selectionColor | ( | Color | foreground | ) |

Set the color of an element when selected.

Parameters

  foreground | The color to be applied. Note that the style is applied on top of the existing style.

Examples
  examples/component/selection.cpp.

Definition at line 78 of file selection_style.cpp.

## selectionBackgroundColor()

Decorator selectionBackgroundColor | ( | Color | foreground | ) |

Set the background color of an element when selected. Note that the style is applied on top of the existing style.

Examples
  examples/component/selection.cpp.

Definition at line 61 of file selection_style.cpp.

## selectionForegroundColor()

Decorator selectionForegroundColor | ( | Color | foreground | ) |

Set the foreground color of an element when selected. Note that the style is applied on top of the existing style.

Definition at line 69 of file selection_style.cpp.

## selectionStyle()

Decorator selectionStyle | ( | std::function< void(Pixel &)> | style | ) |

Set the style of an element when selected.

Parameters

  style | The style to be applied. Note that the style is applied on top of the existing style.

Examples
  examples/component/selection.cpp.

Definition at line 86 of file selection_style.cpp.

## hbox()

Element hbox | ( | Elements | children | ) |

A container displaying elements horizontally one by one.

Parameters

  children | The elements in the container

Returns
  The container.

#### Example

hbox({
text("Left"),
text("Right"),
});

Examples
  examples/component/button_in_frame.cpp, examples/component/canvas_animated.cpp, examples/component/collapsible.cpp, examples/component/flexbox_gallery.cpp, examples/component/focus_cursor.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/input_style.cpp, examples/component/menu2.cpp, examples/component/menu_entries.cpp, examples/component/menu_entries_animated.cpp, examples/component/menu_style.cpp, examples/component/modal_dialog_custom.cpp, examples/component/selection.cpp, examples/component/slider_rgb.cpp, examples/component/tab_vertical.cpp, examples/component/toggle.cpp, examples/component/with_restored_io.cpp, examples/dom/border.cpp, examples/dom/border_colored.cpp, examples/dom/color_gallery.cpp, examples/dom/color_info_palette256.cpp, examples/dom/color_truecolor_HSV.cpp, examples/dom/color_truecolor_RGB.cpp, examples/dom/gauge.cpp, examples/dom/gauge_direction.cpp, examples/dom/graph.cpp, examples/dom/package_manager.cpp, examples/dom/paragraph.cpp, examples/dom/separator.cpp, examples/dom/separator_style.cpp, examples/dom/size.cpp, examples/dom/spinner.cpp, examples/dom/style_blink.cpp, examples/dom/style_bold.cpp, examples/dom/style_color.cpp, examples/dom/style_dim.cpp, examples/dom/style_gallery.cpp, examples/dom/style_hyperlink.cpp, examples/dom/style_inverted.cpp, examples/dom/style_italic.cpp, examples/dom/style_strikethrough.cpp, examples/dom/style_underlined.cpp, examples/dom/style_underlined_double.cpp, and examples/dom/vbox_hbox.cpp.

Definition at line 94 of file hbox.cpp.

## vbox()

Element vbox | ( | Elements | children | ) |

A container displaying elements vertically one by one.

Parameters

  children | The elements in the container

Returns
  The container.

#### Example

vbox({
text("Up"),
text("Down"),
});

Examples
  examples/component/button_animated.cpp, examples/component/button_in_frame.cpp, examples/component/composition.cpp, examples/component/custom_loop.cpp, examples/component/dropdown_custom.cpp, examples/component/flexbox_gallery.cpp, examples/component/focus.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/input_style.cpp, examples/component/linear_gradient_gallery.cpp, examples/component/menu2.cpp, examples/component/menu_entries.cpp, examples/component/menu_entries_animated.cpp, examples/component/menu_multiple.cpp, examples/component/menu_style.cpp, examples/component/modal_dialog.cpp, examples/component/modal_dialog_custom.cpp, examples/component/nested_screen.cpp, examples/component/print_key_press.cpp, examples/component/scrollbar.cpp, examples/component/selection.cpp, examples/component/slider_rgb.cpp, examples/component/tab_horizontal.cpp, examples/component/textarea.cpp, examples/component/toggle.cpp, examples/component/with_restored_io.cpp, examples/dom/border.cpp, examples/dom/border_colored.cpp, examples/dom/border_style.cpp, examples/dom/color_gallery.cpp, examples/dom/color_info_palette256.cpp, examples/dom/color_truecolor_HSV.cpp, examples/dom/color_truecolor_RGB.cpp, examples/dom/dbox.cpp, examples/dom/gauge_direction.cpp, examples/dom/graph.cpp, examples/dom/html_like.cpp, examples/dom/package_manager.cpp, examples/dom/paragraph.cpp, examples/dom/separator.cpp, examples/dom/separator_style.cpp, examples/dom/spinner.cpp, examples/dom/style_color.cpp, and examples/dom/vbox_hbox.cpp.

Definition at line 96 of file vbox.cpp.

## dbox()

Element dbox | ( | Elements | children_ | ) |

Stack several element on top of each other.

Parameters

  children_ | The input element.

Returns
  The right aligned element.

Examples
  examples/component/modal_dialog_custom.cpp, and examples/dom/dbox.cpp.

Definition at line 55 of file dbox.cpp.

## flexbox()

Element flexbox | ( | Elements | children,
|  | FlexboxConfig | config )

A container displaying elements on row/columns and capable of wrapping on the next column/row when full.

Parameters

  children | The elements in the container
  config | The option

Returns
  The container.

#### Example

flexbox({
text("element 1"),
text("element 2"),
text("element 3"),
}, FlexboxConfig()
// .Set(FlexboxConfig::Direction::Column)
// .Set(FlexboxConfig::Wrap::WrapInversed)
// .SetGapMainAxis(1)
// .SetGapCrossAxis(1)
// )
ftxui::flexbox
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
Definition flexbox.cpp:251

Examples
  examples/component/flexbox_gallery.cpp, and examples/component/homescreen.cpp.

Definition at line 251 of file flexbox.cpp.

## gridbox()

Element gridbox | ( | std::vector< Elements > | lines | ) |

A container displaying a grid of elements.

Parameters

  lines | A list of lines, each line being a list of elements.

Returns
  The container.

#### Example

auto cell = [](const char* t) { return text(t) | border; };
auto document = gridbox({
{cell("north-west") , cell("north") , cell("north-east")} ,
{cell("west") , cell("center") , cell("east")} ,
{cell("south-west") , cell("south") , cell("south-east")} ,
});
ftxui::gridbox
Element gridbox(std::vector< Elements > lines)
A container displaying a grid of elements.
Definition gridbox.cpp:173

Output:

╭──────────╮╭──────╮╭──────────╮
│north-west││north ││north-east│
╰──────────╯╰──────╯╰──────────╯
╭──────────╮╭──────╮╭──────────╮
│west ││center││east │
╰──────────╯╰──────╯╰──────────╯
╭──────────╮╭──────╮╭──────────╮
│south-west││south ││south-east│
╰──────────╯╰──────╯╰──────────╯

Examples
  examples/component/focus.cpp, and examples/dom/gridbox.cpp.

Definition at line 173 of file gridbox.cpp.

## hflow()

Element hflow | ( | Elements | children | ) |

A container displaying elements in rows from left to right. When filled, it starts on a new row below.

Parameters

  children | The elements in the container

Returns
  The container.

#### Example

hflow({
text("element 1"),
text("element 2"),
text("element 3"),
});
ftxui::hflow
Element hflow(Elements)
A container displaying elements in rows from left to right. When filled, it starts on a new row below...
Definition flexbox.cpp:269

Examples
  examples/component/homescreen.cpp, examples/dom/hflow.cpp, examples/dom/html_like.cpp, and examples/dom/paragraph.cpp.

Definition at line 269 of file flexbox.cpp.

## vflow()

Element vflow | ( | Elements | children | ) |

A container displaying elements in rows from top to bottom. When filled, it starts on a new columns on the right. filled, it starts on a new row. is full, it starts a new row.

Parameters

  children | The elements in the container

Returns
  The container.

#### Example

vflow({
text("element 1"),
text("element 2"),
text("element 3"),
});
ftxui::vflow
Element vflow(Elements)
A container displaying elements in rows from top to bottom. When filled, it starts on a new columns o...
Definition flexbox.cpp:289

Examples
  examples/dom/vflow.cpp.

Definition at line 289 of file flexbox.cpp.

## flex()

Element flex | ( | Element | child | ) |

Make a child element to expand proportionally to the space left in a container.

#### Examples:

hbox({
text("left") | border ,
text("middle") | border | flex,
text("right") | border,
});
ftxui::flex
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
Definition flex.cpp:123

#### Output:

┌────┐┌─────────────────────────────────────────────────────────┐┌─────┐
│left││middle ││right│
└────┘└─────────────────────────────────────────────────────────┘└─────┘

Examples
  examples/component/flexbox_gallery.cpp, examples/component/focus.cpp, examples/component/homescreen.cpp, examples/component/linear_gradient_gallery.cpp, examples/component/menu_multiple.cpp, examples/component/menu_style.cpp, examples/component/scrollbar.cpp, examples/component/textarea.cpp, examples/dom/gauge.cpp, examples/dom/graph.cpp, and examples/dom/separator.cpp.

Definition at line 123 of file flex.cpp.

## flex_grow()

Element flex_grow | ( | Element | child | ) |

Expand if possible.

Examples
  examples/component/homescreen.cpp.

Definition at line 141 of file flex.cpp.

## flex_shrink()

Element flex_shrink | ( | Element | child | ) |

Minimize if needed.

Definition at line 159 of file flex.cpp.

## xflex()

Element xflex | ( | Element | child | ) |

Expand/Minimize if possible/needed on the X axis.

Examples
  examples/component/gallery.cpp, and examples/component/slider_rgb.cpp.

Definition at line 129 of file flex.cpp.

## xflex_grow()

Element xflex_grow | ( | Element | child | ) |

Expand if possible on the X axis.

Examples
  examples/component/flexbox_gallery.cpp.

Definition at line 147 of file flex.cpp.

## xflex_shrink()

Element xflex_shrink | ( | Element | child | ) |

Minimize if needed on the X axis.

Definition at line 165 of file flex.cpp.

## yflex()

Element yflex | ( | Element | child | ) |

Expand/Minimize if possible/needed on the Y axis.

Definition at line 135 of file flex.cpp.

## yflex_grow()

Element yflex_grow | ( | Element | child | ) |

Expand if possible on the Y axis.

Examples
  examples/component/flexbox_gallery.cpp.

Definition at line 153 of file flex.cpp.

## yflex_shrink()

Element yflex_shrink | ( | Element | child | ) |

Minimize if needed on the Y axis.

Definition at line 171 of file flex.cpp.

## notflex()

Element notflex | ( | Element | child | ) |

Make the element not flexible.

Examples
  examples/component/flexbox_gallery.cpp.

Definition at line 177 of file flex.cpp.

## filler()

Element filler | ( |  | ) |

An element that will take expand proportionally to the space left in a container.

Examples
  examples/component/dropdown_custom.cpp, examples/component/flexbox_gallery.cpp, examples/component/homescreen.cpp, examples/component/menu_style.cpp, examples/component/modal_dialog_custom.cpp, examples/component/with_restored_io.cpp, examples/dom/gauge_direction.cpp, examples/dom/package_manager.cpp, examples/dom/paragraph.cpp, examples/dom/spinner.cpp, examples/dom/style_color.cpp, and examples/dom/vbox_hbox.cpp.

Definition at line 98 of file flex.cpp.

## size()

Decorator size | ( | WidthOrHeight | direction,
|  | Constraint | constraint,
|  | int | value )

Apply a constraint on the size of an element.

Parameters

  direction | Whether the WIDTH of the HEIGHT of the element must be constrained.
  constraint | The type of constaint.
  value | The value.

Examples
  examples/component/button_in_frame.cpp, examples/component/canvas_animated.cpp, examples/component/checkbox_in_frame.cpp, examples/component/dropdown_custom.cpp, examples/component/flexbox_gallery.cpp, examples/component/focus.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input_in_frame.cpp, examples/component/menu_entries.cpp, examples/component/menu_in_frame.cpp, examples/component/modal_dialog.cpp, examples/component/modal_dialog_custom.cpp, examples/component/radiobox_in_frame.cpp, examples/component/selection.cpp, examples/component/slider_direction.cpp, examples/component/slider_rgb.cpp, examples/component/textarea.cpp, examples/component/with_restored_io.cpp, examples/dom/graph.cpp, examples/dom/hflow.cpp, examples/dom/package_manager.cpp, examples/dom/size.cpp, examples/dom/spinner.cpp, and examples/dom/vflow.cpp.

Definition at line 89 of file size.cpp.

## frame()

Element frame | ( | Element | child | ) |

Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container. In this case only a smaller portion is displayed. The view is scrollable to make the focused element visible.

See also
  frame
  xframe
  yframe

Examples
  examples/component/button_in_frame.cpp, examples/component/checkbox_in_frame.cpp, examples/component/dropdown_custom.cpp, examples/component/focus.cpp, examples/component/homescreen.cpp, examples/component/input_in_frame.cpp, examples/component/menu_entries.cpp, examples/component/menu_entries_animated.cpp, examples/component/menu_in_frame.cpp, examples/component/menu_in_frame_horizontal.cpp, examples/component/radiobox_in_frame.cpp, examples/component/scrollbar.cpp, and examples/component/selection.cpp.

Definition at line 118 of file frame.cpp.

## xframe()

Element xframe | ( | Element | child | ) |

Same as frame, but only on the x-axis.

See also
  frame
  xframe
  yframe

Definition at line 126 of file frame.cpp.

## yframe()

Element yframe | ( | Element | child | ) |

Same as frame, but only on the y-axis.

See also
  frame
  xframe
  yframe

Examples
  examples/component/homescreen.cpp.

Definition at line 134 of file frame.cpp.

## focus()

Element focus | ( | Element | child | ) |

Set the child to be the one focused among its siblings.

Parameters

  child | The element to be focused.

Examples
  examples/component/focus_cursor.cpp.

Definition at line 101 of file frame.cpp.

## select()

Element select | ( | Element | child | ) |

Set the child to be the one focused among its siblings.

This is deprecated. Use focus instead.

Parameters

  child | The element to be focused.

Definition at line 108 of file frame.cpp.

## focusCursorBlock()

Element focusCursorBlock | ( | Element | child | ) |

Same as focus, but set the cursor shape to be a still block.

See also
  focus
  focusCursorBlock
  focusCursorBlockBlinking
  focusCursorBar
  focusCursorBarBlinking
  focusCursorUnderline
  focusCursorUnderlineBlinking

Examples
  examples/component/focus_cursor.cpp.

Definition at line 147 of file frame.cpp.

## focusCursorBlockBlinking()

Element focusCursorBlockBlinking | ( | Element | child | ) |

Same as focus, but set the cursor shape to be a blinking block.

See also
  focus
  focusCursorBlock
  focusCursorBlockBlinking
  focusCursorBar
  focusCursorBarBlinking
  focusCursorUnderline
  focusCursorUnderlineBlinking

Examples
  examples/component/focus_cursor.cpp.

Definition at line 161 of file frame.cpp.

## focusCursorBar()

Element focusCursorBar | ( | Element | child | ) |

Same as focus, but set the cursor shape to be a still block.

See also
  focus
  focusCursorBlock
  focusCursorBlockBlinking
  focusCursorBar
  focusCursorBarBlinking
  focusCursorUnderline
  focusCursorUnderlineBlinking

Examples
  examples/component/focus_cursor.cpp.

Definition at line 175 of file frame.cpp.

## focusCursorBarBlinking()

Element focusCursorBarBlinking | ( | Element | child | ) |

Same as focus, but set the cursor shape to be a blinking bar.

See also
  focus
  focusCursorBlock
  focusCursorBlockBlinking
  focusCursorBar
  focusCursorBarBlinking
  focusCursorUnderline
  focusCursorUnderlineBlinking

Examples
  examples/component/focus_cursor.cpp.

Definition at line 189 of file frame.cpp.

## focusCursorUnderline()

Element focusCursorUnderline | ( | Element | child | ) |

Same as focus, but set the cursor shape to be a still underline.

See also
  focus
  focusCursorBlock
  focusCursorBlockBlinking
  focusCursorBar
  focusCursorBarBlinking
  focusCursorUnderline
  focusCursorUnderlineBlinking

Examples
  examples/component/focus_cursor.cpp.

Definition at line 203 of file frame.cpp.

## focusCursorUnderlineBlinking()

Element focusCursorUnderlineBlinking | ( | Element | child | ) |

Same as focus, but set the cursor shape to be a blinking underline.

See also
  focus
  focusCursorBlock
  focusCursorBlockBlinking
  focusCursorBar
  focusCursorBarBlinking
  focusCursorUnderline
  focusCursorUnderlineBlinking

Examples
  examples/component/focus_cursor.cpp.

Definition at line 217 of file frame.cpp.

## vscroll_indicator()

Element vscroll_indicator | ( | Element | child | ) |

Display a vertical scrollbar to the right. colors.

Examples
  examples/component/button_in_frame.cpp, examples/component/checkbox_in_frame.cpp, examples/component/dropdown_custom.cpp, examples/component/homescreen.cpp, examples/component/input_in_frame.cpp, examples/component/menu_in_frame.cpp, examples/component/radiobox_in_frame.cpp, and examples/component/selection.cpp.

Definition at line 21 of file scroll_indicator.cpp.

## hscroll_indicator()

Element hscroll_indicator | ( | Element | child | ) |

Display an horizontal scrollbar to the bottom. colors.

Examples
  examples/component/menu_in_frame_horizontal.cpp.

Definition at line 76 of file scroll_indicator.cpp.

## reflect()

Decorator reflect | ( | Box & | box | ) |

Definition at line 43 of file reflect.cpp.

## clear_under()

Element clear_under | ( | Element | element | ) |

Before drawing |child|, clear the pixels below. This is useful in.

See also
  ftxui::dbox

Examples
  examples/component/modal_dialog_custom.cpp.

Definition at line 38 of file clear_under.cpp.

## hcenter()

Element hcenter | ( | Element | child | ) |

Center an element horizontally.

Parameters

  child | The decorated element.

Returns
  The centered element.

Examples
  examples/component/flexbox_gallery.cpp, examples/component/homescreen.cpp, examples/component/menu2.cpp, examples/component/menu_style.cpp, examples/dom/hflow.cpp, examples/dom/size.cpp, and examples/dom/vflow.cpp.

Definition at line 15 of file composite_decorator.cpp.

## vcenter()

Element vcenter | ( | Element | child | ) |

Center an element vertically.

Parameters

  child | The decorated element.

Returns
  The centered element.

Definition at line 23 of file composite_decorator.cpp.

## center()

Element center | ( | Element | child | ) |

Center an element horizontally and vertically.

Parameters

  child | The decorated element.

Returns
  The centered element.

Examples
  examples/component/flexbox_gallery.cpp, examples/component/focus.cpp, examples/component/homescreen.cpp, examples/component/input_style.cpp, examples/component/linear_gradient_gallery.cpp, examples/component/modal_dialog.cpp, examples/component/modal_dialog_custom.cpp, examples/component/renderer.cpp, examples/component/resizable_split.cpp, examples/component/with_restored_io.cpp, examples/dom/dbox.cpp, examples/dom/gauge_direction.cpp, examples/dom/linear_gradient.cpp, and examples/dom/separator.cpp.

Definition at line 31 of file composite_decorator.cpp.

## align_right()

Element align_right | ( | Element | child | ) |

Align an element on the right side.

Parameters

  child | The decorated element.

Returns
  The right aligned element.

Examples
  examples/dom/table.cpp.

Definition at line 39 of file composite_decorator.cpp.

## nothing()

Element nothing | ( | Element | element | ) |

A decoration doing absolutely nothing.

Definition at line 28 of file util.cpp.

## Render() [1/3]

void Render | ( | Screen & | screen,
|  | const Element & | element )

Display an element on a ftxui::Screen.

Examples
  examples/dom/border.cpp, examples/dom/border_colored.cpp, examples/dom/border_style.cpp, examples/dom/canvas.cpp, examples/dom/color_gallery.cpp, examples/dom/color_info_palette256.cpp, examples/dom/color_truecolor_HSV.cpp, examples/dom/color_truecolor_RGB.cpp, examples/dom/dbox.cpp, examples/dom/gauge.cpp, examples/dom/gauge_direction.cpp, examples/dom/graph.cpp, examples/dom/gridbox.cpp, examples/dom/hflow.cpp, examples/dom/html_like.cpp, examples/dom/linear_gradient.cpp, examples/dom/package_manager.cpp, examples/dom/paragraph.cpp, examples/dom/separator.cpp, examples/dom/separator_style.cpp, examples/dom/size.cpp, examples/dom/spinner.cpp, examples/dom/style_blink.cpp, examples/dom/style_bold.cpp, examples/dom/style_color.cpp, examples/dom/style_dim.cpp, examples/dom/style_gallery.cpp, examples/dom/style_hyperlink.cpp, examples/dom/style_inverted.cpp, examples/dom/style_italic.cpp, examples/dom/style_strikethrough.cpp, examples/dom/style_underlined.cpp, examples/dom/style_underlined_double.cpp, examples/dom/table.cpp, examples/dom/vbox_hbox.cpp, and examples/dom/vflow.cpp.

Definition at line 88 of file node.cpp.

## Render() [2/3]

void Render | ( | Screen & | screen,
|  | Node * | node )

Display an element on a ftxui::Screen.

Definition at line 95 of file node.cpp.

## Render() [3/3]

void Render | ( | Screen & | screen,
|  | Node * | node,
|  | Selection & | selection )

Definition at line 100 of file node.cpp.

## GetNodeSelectedContent()

std::string GetNodeSelectedContent | ( | Screen & | screen,
|  | Node * | node,
|  | Selection & | selection )

Definition at line 172 of file node.cpp.

## GetColorInfo() [1/2]

ColorInfo GetColorInfo | ( | Color::Palette256 | index | ) |

Definition at line 272 of file color_info.cpp.

## GetColorInfo() [2/2]

ColorInfo GetColorInfo | ( | Color::Palette16 | index | ) |

Definition at line 276 of file color_info.cpp.

## wchar_width()

int wchar_width | ( | wchar_t | ucs | ) |

Definition at line 1313 of file string.cpp.

## wstring_width()

int wstring_width | ( | const std::wstring & | text | ) |

Definition at line 1317 of file string.cpp.

## to_string()

std::string to_string | ( | const std::wstring & | s | ) |

Convert a UTF8 std::string into a std::wstring.

Definition at line 1565 of file string.cpp.

## to_wstring() [1/2]

std::wstring to_wstring | ( | const std::string & | s | ) |

Convert a std::wstring into a UTF8 std::string.

Definition at line 1637 of file string.cpp.

## to_wstring() [2/2]

template<typename T>

std::wstring to_wstring | ( | T | s | ) |

Definition at line 15 of file string.hpp.

## string_width()

int string_width | ( | const std::string & | input | ) |

Definition at line 1330 of file string.cpp.

## Utf8ToGlyphs()

std::vector< std::string > Utf8ToGlyphs | ( | const std::string & | input | ) |

Definition at line 1357 of file string.cpp.

## CellToGlyphIndex()

std::vector< int > CellToGlyphIndex | ( | const std::string & | input | ) |

Definition at line 1464 of file string.cpp.

## CatchEvent() [3/3]

Component CatchEvent | ( | Component | child,
|  | std::function< bool(Event event)> | on_event )

Return a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.

Parameters

  child | The wrapped component.
  on_event | The function drawing the interface.

### Example

auto screen = ScreenInteractive::TerminalOutput();
auto renderer = Renderer([] {
return text("My interface");
});
auto component = CatchEvent(renderer, [&](Event event) {
if (event == Event::Character('q')) {
screen.ExitLoopClosure()();
return true;
}
return false;
});
screen.Loop(component);

Definition at line 54 of file catch_event.cpp.

## Slider() [5/14]

template Component Slider | ( | SliderOption< int8_t > |  | ) |

## Slider() [6/14]

template Component Slider | ( | SliderOption< int16_t > |  | ) |

## Slider() [7/14]

template Component Slider | ( | SliderOption< int32_t > |  | ) |

## Slider() [8/14]

template Component Slider | ( | SliderOption< int64_t > |  | ) |

## Slider() [9/14]

template Component Slider | ( | SliderOption< uint8_t > |  | ) |

## Slider() [10/14]

template Component Slider | ( | SliderOption< uint16_t > |  | ) |

## Slider() [11/14]

template Component Slider | ( | SliderOption< uint32_t > |  | ) |

## Slider() [12/14]

template Component Slider | ( | SliderOption< uint64_t > |  | ) |

## Slider() [13/14]

template Component Slider | ( | SliderOption< float > |  | ) |

## Slider() [14/14]

template Component Slider | ( | SliderOption< double > |  | ) |

## EatCodePoint() [1/2]

bool EatCodePoint | ( | const std::string & | input,
|  | size_t | start,
|  | size_t * | end,
|  | uint32_t * | ucs )

Definition at line 1174 of file string.cpp.

## EatCodePoint() [2/2]

bool EatCodePoint | ( | const std::wstring & | input,
|  | size_t | start,
|  | size_t * | end,
|  | uint32_t * | ucs )

Definition at line 1244 of file string.cpp.

## IsCombining()

bool IsCombining | ( | uint32_t | ucs | ) |

Definition at line 1282 of file string.cpp.

## IsFullWidth()

bool IsFullWidth | ( | uint32_t | ucs | ) |

Definition at line 1286 of file string.cpp.

## IsControl()

bool IsControl | ( | uint32_t | ucs | ) |

Definition at line 1293 of file string.cpp.

## CodepointToWordBreakProperty()

WordBreakProperty CodepointToWordBreakProperty | ( | uint32_t | codepoint | ) |

Definition at line 1307 of file string.cpp.

## GlyphPrevious()

size_t GlyphPrevious | ( | const std::string & | input,
|  | size_t | start )

Definition at line 1399 of file string.cpp.

## GlyphNext()

size_t GlyphNext | ( | const std::string & | input,
|  | size_t | start )

Definition at line 1424 of file string.cpp.

## GlyphIterate()

size_t GlyphIterate | ( | const std::string & | input,
|  | int | glyph_offset,
|  | size_t | start )

Definition at line 1450 of file string.cpp.

## GlyphCount()

int GlyphCount | ( | const std::string & | input | ) |

Definition at line 1505 of file string.cpp.

## Utf8ToWordBreakProperty()

std::vector< WordBreakProperty > Utf8ToWordBreakProperty | ( | const std::string & | input | ) |

Definition at line 1533 of file string.cpp.

## IsWordBreakingCharacter()

bool IsWordBreakingCharacter | ( | const std::string & | input,
|  | size_t | glyph_index )

## Variable Documentation

## g_uniformize

const std::map<std::string, std::string> g_uniformize

Definition at line 19 of file terminal_input_parser.cpp.

## palette256

const std::array<ColorInfo, 256> palette256

Definition at line 13 of file color_info.cpp.