Elements
Even though it's possible to create custom elements Anathema aims to provide the necessary building blocks to represent almost any layout without the need to do so.
Default attributes
Elements that draw them selves (e.g text
, span
and border
) support these default
attributes:
foreground
Foreground colour
Valid values:
- hex:
#ffaabb
- string: "green"
background
Background colour (see foreground
for valid values)
bold
Valid values:
true
or false
italic
Valid values:
true
or false
display
Changes the behaviour of the rendering and layout step.
show
is default and renders the element.
hide
will not paint the element, but it will be part of the layout,
exclude
excludes it from layout as well, thus the element won't take up any space and be hidden.
Valid Values:
show
, hide
or exclude
fill
Fill the unpainted space with a string.
Example:
border [width: 10, height: 5, fill: "+-"]
text "Hello"
┌────────┐
│Hello-+-│
│+-+-+-+-│
│+-+-+-+-│
└────────┘
Default widgets
The following is a list of available widgets and their template tags:
- Text (template tag:
text
) - Span (template tag:
span
) - Border (template tag:
border
) - Alignment (template tag:
align
) - VStack (template tag:
vstack
) - HStack (template tag:
hstack
) - ZStack (template tag:
zstack
) - Expand (template tag:
expand
) - Spacer (template tag:
spacer
) - Position (template tag:
position
) - Overflow (template tag:
overflow
) - Canvas (template tag:
canvas
) - Container (template tag:
container
) - Column (template tag:
column
) - Row (template tag:
row
) - Padding (template tag:
padding
)