ToastStack data
Warning pills that pile up one under another.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| items* | list of string | ||
| each | number (0 to 5) | 0.5 | |
| color | color | "bad" | |
| w | number (200 to 1040) | 640 |
* required. Every node also takes the common props: id, motion, start, place, scale, rotate, opacity, w, h. A colour is a palette name, never a value.
Parts#
Named parts can be restyled from outside without making a new component: "parts": { "root": { … } }.
| Part | Is a |
|---|---|
| root | box |
| toast | box |
Example#
{"el": "ToastStack", "items": ["Where do I say it?", "Is the light okay?"]}How it is made#
This component is plain data. Its whole definition is the tree below: copy it into a scene's components list under a new name to make your own version. See Custom components.
{
"el": "box",
"gap": 16,
"align": "center",
"motion": [{"do": "stagger", "each": "$each"}],
"children": [
{
"$each": "$items",
"node": {
"el": "box",
"id": "toast",
"surface": "toast",
"dir": "row",
"gap": 18,
"align": "center",
"w": "$w",
"border": "$color",
"borderW": 2,
"motion": [{"do": "enter", "from": {"y": 34, "scale": 0.9, "opacity": 0}, "curve": "bouncy"}],
"children": [
{
"el": "icon",
"name": {"$if": "=index%2", "then": "x", "else": "bell"},
"size": 34,
"color": "$color",
"strokeW": 2.6
},
{
"el": "text",
"text": "$item",
"size": 34,
"weight": 600,
"font": "body",
"color": "white"
}
]
}
}
]
}