Widgets

/

layout

Align

Fills its parent and places its object at an alignment.

Placing at an edge or corner

Align fills its parent and places its object at an alignment: topLeft, topMid, topRight, midLeft, mid, midRight, bottomLeft, bottomMid or bottomRight. to is also written align or alignment.

LAYR
Container(
  .config(
    w: 280
    h: 140
    .border(color: line, width: 1)
    color: panel
    cornerRadius: 14
    padding: all(14)
  )
  .obj(
    Align(
      .config(to: bottomRight)
      .obj(
        Container(
          .config(color: accent, cornerRadius: 8, padding: sym(x: 12, y: 6))
          .obj(Text(.config(size: 13, color: onAccent) .obj('Continue')))
        )
      )
    )
  )
)

Config keys

KeyTypeDefaultMeaning
to (align, alignment)alignmidWhere to place the object.
margininsetsSpace outside the object: all(8), sym(x: 8, y: 4), only(top: 8).
opacitynumOpacity from 0 to 1.
hide (hidden)boolRemoves the object from layout and the accessibility tree.
shrinknum1Shrink priority when space runs out. Lower shrinks first; 0 never shrinks.
flexnum1Share of remaining space for fill sizes.
cursorauto | pointer | text | grab | grabbing | move | notAllowed | crosshair | nonePointer cursor.
className (class)txtExtra CSS class names: styling hooks for your own stylesheet (hover rules, third-party CSS).

Slots

  • .obj: one object, the default slot