Skip to main content

Common attributes

Every tag takes the base attributes below. The tag pages that follow list only what they add.

Common Base Attributes​

AttributeDescription
idUnique identifier for anchoring.
displayLayout mode; valid values: "block", "relative", "flex".
marginShorthand for all margins; supports CSS-like values.
margin-xHorizontal margins (left/right).
margin-yVertical margins (top/bottom).
margin-topTop margin.
margin-rightRight margin.
margin-bottomBottom margin.
margin-leftLeft margin.
paddingShorthand for all paddings; supports CSS-like values.
padding-xHorizontal padding (left/right).
padding-yVertical padding (top/bottom).
padding-topTop padding.
padding-rightRight padding.
padding-bottomBottom padding.
padding-leftLeft padding.
widthElement width; can be a number, "auto", "content", or a percentage (e.g., "50%").
heightElement height; can be a number, "auto", "content", or a percentage.
alignHorizontal alignment; valid values: "left", "center", "right".
vertical-alignVertical alignment; valid values: "top", "center", "bottom".
xX-coordinate for relative positioning.
yY-coordinate for relative positioning.
spacingGap between items in flex layouts (number).
justify-contentFlex layout horizontal distribution; valid values: "flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly".
align-itemsFlex layout vertical alignment per line; valid values: "flex-start", "flex-end", "center", "stretch".
nameOptional element name for setting window names/identifiers.

Display Flex - Deep Dive​

Here we will cover more in details how display=flex works.

The main attribute you can use with display=flex:

  • justify-content which controls horizontal positioning.
  • align-items which controls the vertical alignment of elements in each row.
justify-content Examples
justify-content=<c color="wikititle">flex-start</c>
<inline width="auto" justify-content="flex-start">
{% for i in range(5) %}
<thin-board width="30" height="{{ 10 * (i+1) }}" />
{% endfor %}
</inline>

<spacer></spacer>
justify-content=<c color="wikititle">flex-end</c>
<inline width="auto" justify-content="flex-end">
{% for i in range(5) %}
<thin-board width="30" height="{{ 10 * (i+1) }}" />
{% endfor %}
</inline>

<spacer></spacer>
justify-content=<c color="wikititle">center</c>
<inline width="auto" justify-content="center">
{% for i in range(5) %}
<thin-board width="30" height="{{ 10 * (i+1) }}" />
{% endfor %}
</inline>

<spacer></spacer>
justify-content=<c color="wikititle">space-between</c>
<inline width="auto" justify-content="space-between">
{% for i in range(5) %}
<thin-board width="30" height="{{ 10 * (i+1) }}" />
{% endfor %}
</inline>

<spacer></spacer>
justify-content=<c color="wikititle">space-evenly</c>
<inline width="auto" justify-content="space-evenly">
{% for i in range(5) %}
<thin-board width="30" height="{{ 10 * (i+1) }}" />
{% endfor %}
</inline>

<spacer></spacer>
justify-content=<c color="wikititle">space-around</c>
<inline width="auto" justify-content="space-around">
{% for i in range(5) %}
<thin-board width="30" height="{{ 10 * (i+1) }}" />
{% endfor %}
</inline>

image

align-items Examples
<inline>
align-items=<c color="wikititle">flex-start</c>
<inline width="auto" align-items="flex-start">
{% for i in range(5) %}
<thin-board width="30" height="{{ 32 + 10 * (i) }}" />
{% endfor %}
</inline>

<spacer></spacer>
align-items=<c color="wikititle">flex-end</c>
<inline width="auto" align-items="flex-end">
{% for i in range(5) %}
<thin-board width="30" height="{{ 32 + 10 * (i) }}" />
{% endfor %}
</inline>

<spacer></spacer>
align-items=<c color="wikititle">center</c>
<inline width="auto" align-items="center">
{% for i in range(5) %}
<thin-board width="30" height="{{ 32 + 10 * (i) }}" />
{% endfor %}
</inline>

<spacer></spacer>
align-items=<c color="wikititle">stretch</c>
<inline width="auto" align-items="stretch">
{% for i in range(5) %}
<thin-board width="30" height="{{ 32 + 10 * (i) }}" />
{% endfor %}
</inline>
</inline>

image