Functions and macros for building the element tree returned by
Tuix.App.render/1.
Box props
:width/:height- integer cells,{:percent, n}, or a"50%"string:flex_direction-:column(default) or:row:flex_grow- share of leftover space along the parent's main axis:gap- cells between children:padding- cells inside the border on all sides:border-:none(default),:single,:rounded,:double, ortrue(alias for:single):border_color- color of the border (seeTuix.Color):title- text drawn into the top border:bg- background fill color
Text props
:fg/:bg- colors (seeTuix.Color):attrs- list of:bold,:dim,:italic,:underline,:blink,:reverse,:strikethrough
Examples
box border: :rounded, padding: 1, gap: 1 do
text("Welcome", fg: :yellow)
text("Press q to quit")
end
Summary
Functions
Builds a box element.
Accepts props and children either as a do block or as a list:
box(border: :single) # empty box
box [border: :single] do
text("hi")
end
box([border: :single], [text("hi")])
@spec text( String.t(), keyword() ) :: Tuix.Element.t()
Builds a text element.
text("Hello")
text("Hello", fg: "#00FF00", attrs: [:bold])Multi-line content (embedded newlines) renders one line per row.