Mid
Fills its parent and centres its object.
Also written Center, Centre, Cen; layr format rewrites these to Mid.
Centring
Mid fills its parent and puts its object in the middle, on both axes. It is the shortest way to centre something.
Container(
.config(w: 280, h: 140, color: sunken, cornerRadius: 14)
.obj(
Mid(
Container(
.config(
.border(color: line, width: 1)
color: panel
cornerRadius: 999
padding: sym(x: 14, y: 6)
)
.obj(Text(.config(size: 13) .obj('Nothing here yet')))
)
)
)
)Config keys
| Key | Type | Default | Meaning |
|---|---|---|---|
margin | insets | Space outside the object: all(8), sym(x: 8, y: 4), only(top: 8). | |
opacity | num | Opacity from 0 to 1. | |
hide (hidden) | bool | Removes the object from layout and the accessibility tree. | |
shrink | num | 1 | Shrink priority when space runs out. Lower shrinks first; 0 never shrinks. |
flex | num | 1 | Share of remaining space for fill sizes. |
cursor | auto | pointer | text | grab | grabbing | move | notAllowed | crosshair | none | Pointer cursor. | |
className (class) | txt | Extra CSS class names: styling hooks for your own stylesheet (hover rules, third-party CSS). |
Slots
.obj: one object, the default slot