4#ifndef FTXUI_DOM_ELEMENTS_HPP
5#define FTXUI_DOM_ELEMENTS_HPP
70 Color unselected_color,
71 Color selected_color);
75 Color unselected_color,
76 Color selected_color);
106Element canvas(
int width,
int height, std::function<
void(Canvas&)>);
221#include "ftxui/dom/take_any_args.hpp"
An adapter. Own or reference an immutable object.
#define FTXUI_EXPORT(component)
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Draw window with a title and a border around the element.
Element borderDouble(Element child)
Draw a double border around the element.
Element text(std::string_view text)
Display a piece of UTF8 encoded unicode text.
Element focusCursorBarBlinking(Element child)
Same as focus, but set the cursor shape to be a blinking bar.
Element xflex(Element)
Expand/Minimize if possible/needed on the X axis.
Element gaugeDirection(float progress, Direction direction)
Draw a high definition progress bar progressing in specified direction.
Decorator focusPositionRelative(float x, float y)
Used inside a frame, this force the view to be scrolled toward a a given position....
Element separatorStyled(BorderStyle style)
Draw a vertical or horizontal separation in between two other elements.
Element xflex_grow(Element)
Expand if possible on the X axis.
Element underlinedDouble(Element child)
Apply a underlinedDouble to text.
Element clear_under(Element element)
Before drawing |child|, clear the cells below. This is useful in combination with dbox.
Element borderDashed(Element child)
Draw a dashed border around the element.
Element separatorEmpty()
Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
Element vscroll_indicator(Element child)
Display a vertical scrollbar on the right. Colors follow the content.
Element nothing(Element element)
A decoration doing absolutely nothing.
Element paragraphAlignLeft(std::string_view the_text)
Return an element drawing the paragraph on multiple lines, aligned on the left.
Decorator size(WidthOrHeight direction, Constraint constraint, int value)
Apply a constraint on the size of an element.
Direction
Direction is an enumeration that represents the four cardinal directions.
Element flex(Element child)
Make a child element to expand proportionally to the space left in a container.
Element hyperlink(std::string_view link, Element child)
Make the rendered area clickable using a web browser. The link will be opened when the user clicks on...
Element gaugeRight(float progress)
Draw a high definition progress bar progressing from left to right.
Element focusCursorUnderlineBlinking(Element child)
Same as focus, but set the cursor shape to be a blinking underline.
Element bold(Element child)
Use a bold font, for elements with more emphasis.
Element separatorLight()
Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
Element spinner(int charset_index, size_t image_index)
Useful to represent the effect of time and/or events. This displays an ASCII art "video".
Element borderRounded(Element child)
Draw a rounded border around the element.
Element yflex(Element)
Expand/Minimize if possible/needed on the Y axis.
Element flex_shrink(Element child)
Minimize if needed.
Element focusCursorBar(Element child)
Same as focus, but set the cursor shape to be a still block.
Element focusCursorBlock(Element child)
Same as focus, but set the cursor shape to be a still block.
Element vtext(std::string_view text)
Display a piece of unicode text vertically.
Element underlined(Element child)
Underline the given element.
Element center(Element child)
Center an element horizontally and vertically.
Element paragraphAlignJustify(std::string_view the_text)
Return an element drawing the paragraph on multiple lines, aligned using a justified alignment....
Element focusCursorUnderline(Element child)
Same as focus, but set the cursor shape to be a still underline.
Element borderHeavy(Element child)
Draw a heavy border around the element.
Element inverted(Element child)
Add a filter that will invert the foreground and the background colors.
Element gaugeUp(float progress)
Draw a high definition progress bar progressing from bottom to top.
Element align_right(Element child)
Align an element on the right side.
Decorator focusPosition(int x, int y)
Used inside a frame, this force the view to be scrolled toward a a given position....
Element yflex_grow(Element)
Expand if possible on the Y axis.
Element hscroll_indicator(Element child)
Display a horizontal scrollbar at the bottom. Colors follow the content.
Element flex_grow(Element child)
Expand if possible.
Element separatorDashed()
Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
Element notflex(Element child)
Make the element not flexible.
Element strikethrough(Element child)
Apply a strikethrough to text.
Element italic(Element child)
Apply a underlinedDouble to text.
Element dbox(Elements children_)
Stack several element on top of each other.
Element xflex_shrink(Element)
Minimize if needed on the X axis.
Decorator borderWith(const Cell &pixel)
Same as border but with a constant Cell around the element.
Element gaugeLeft(float progress)
Draw a high definition progress bar progressing from right to left.
Element paragraphAlignCenter(std::string_view the_text)
Return an element drawing the paragraph on multiple lines, aligned on the center.
Element borderLight(Element child)
Draw a light border around the element.
Element focus(Element child)
Set the child to be the one focused among its siblings.
Element paragraph(std::string_view the_text)
Return an element drawing the paragraph on multiple lines.
Element bgcolor(Color color, Element child)
Set the background color of an element.
Decorator borderStyled(BorderStyle style)
Same as border but with different styles.
Element paragraphAlignRight(std::string_view the_text)
Return an element drawing the paragraph on multiple lines, aligned on the right.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element filler()
An element that will take expand proportionally to the space left in a container.
Element dim(Element child)
Use a light font, for elements with less emphasis.
Element automerge(Element child)
Enable character to be automatically merged with others nearby.
Element separatorCharacter(std::string_view value)
Draw a vertical or horizontal separation in between two other elements.
Element blink(Element child)
The text drawn alternates in between visible and hidden.
Element vcenter(Element child)
Center an element vertically.
Element separatorDouble()
Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
Element focusCursorBlockBlinking(Element child)
Same as focus, but set the cursor shape to be a blinking block.
Element color(Color color, Element child)
Set the foreground color of an element.
Element gauge(float progress)
Draw a high definition progress bar.
Element border(Element child)
Draw a border around the element.
Element separatorHeavy()
Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
Element borderEmpty(Element child)
Draw an empty border around the element.
Element yflex_shrink(Element)
Minimize if needed on the Y axis.
Element hcenter(Element child)
Center an element horizontally.
Element vbox(Elements children)
A container displaying elements vertically one by one.
BorderStyle
BorderStyle is an enumeration that represents the different styles of borders that can be applied to ...
Element gaugeDown(float progress)
Draw a high definition progress bar progressing from top to bottom.
The FTXUI ftxui::Dimension:: namespace.
bool extend_beyond_screen
The FTXUI ftxui:: namespace.
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
Element separatorVSelector(float up, float down, Color unselected_color, Color selected_color)
Draw an vertical bar, with the area in between up/downcolored differently.
std::shared_ptr< Node > Element
Element xframe(Element child)
Same as frame, but only on the x-axis.
FTXUI_EXPORT(DOM) Element gridbox(std Element hflow(Elements)
A container displaying elements in rows from left to right. When filled, it starts on a new row below...
FTXUI_EXPORT(DOM) Element separatorCharacter(std Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
Draw a horizontal bar, with the area in between left/right colored differently.
Element hbox(Elements children)
A container displaying elements horizontally one by one.
std::vector< Element > Elements
Decorator selectionForegroundColor(Color foreground)
Set the foreground color of an element when selected. Note that the style is applied on top of the ex...
Component operator|(Component component, ComponentDecorator decorator)
Decorator selectionBackgroundColor(Color foreground)
Set the background color of an element when selected. Note that the style is applied on top of the ex...
std::function< Element(Element)> Decorator
Element yframe(Element child)
Same as frame, but only on the y-axis.
Decorator selectionColor(Color foreground)
Set the color of an element when selected.
Element selectionStyleReset(Element child)
Reset the selection style of an element.
Decorator reflect(Box &box)
std::function< std::vector< int >(int, int)> GraphFunction
Element gridbox(std::vector< Elements > lines)
A container displaying a grid of elements.
Element canvas(int width, int height, std::function< void(Canvas &)>)
Produce an element drawing a canvas of requested size.
Element frame(Element child)
Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
Component & operator|=(Component &component, ComponentDecorator decorator)
Element select(Element e)
Set the child to be the one focused among its siblings.
Decorator selectionStyle(std::function< void(Cell &)> style)
Set the style of an element when selected.
Element vflow(Elements)
A container displaying elements in rows from top to bottom. When filled, it starts on a new columns o...
Element graph(GraphFunction graph_function)
Draw a graph using a GraphFunction.