<attr>
Declares one prop of a tag of your own in full: its name, type and default value.
<tag name="price-tag"
amount="0.0">
<attr name="currency"
type="text"
default="USD"/>
<row style="gap-6 items-center">
<text @text="$amount"
style="font-bold text-xl"></text>
<text @text="$currency"
style="muted"></text>
</row>
</tag>
<column style="gap-8">
<price-tag amount="24.5"/>
<price-tag amount="19.5"
currency="EUR"/>
</column>
Attributes
| Name | What it does | Default |
|---|---|---|
bind |
true makes the attribute two-way: the instance passes a $variable and a write to $name inside the body writes that variable. boolean |
false |
default |
The value when the instance gives none; empty without one. string |
|
name |
The attribute's name ($name in the body). string |
|
type |
What the attribute takes; a value of the wrong type warns and the default stands. text, int, number, bool, color, style, url, command |
text |
Any tag also takes gestures: @on.tap, @on.longpress, @on.doubletap and @on.swipeleft (and right, up and down). @click runs on a tap too.