BubbleStack data
Messages from named people piling up, one after another: requests coming in.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| messages* | list | [{name, text}] | |
| each | number (0 to 5) | 0.7 | |
| w | number (300 to 1700) | 900 | |
| ink | color | "ink" | |
| accent | color | "accent" |
* 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 |
| bubble | box |
Example#
{
"el": "BubbleStack",
"messages": [
{"name": "Maya", "text": "Can you cut this to thirty seconds?"},
{"name": "Omar", "text": "And add captions?"}
]
}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": 22,
"align": "start",
"motion": [
{
"do": "stagger",
"each": "$each",
"motion": [{"do": "enter", "from": {"y": 60, "scale": 0.92, "opacity": 0}, "curve": "bouncy"}]
}
],
"children": [
{
"$each": "$messages",
"node": {
"el": "box",
"dir": "row",
"gap": 22,
"align": "center",
"children": [
{
"el": "box",
"dir": "stack",
"w": 84,
"h": 84,
"radius": 999,
"fill": "$accent",
"children": [{"el": "icon", "name": "user", "size": 44, "color": "onAccent", "strokeW": 2.2}]
},
{
"el": "box",
"id": "bubble",
"surface": "card",
"pad": [22, 32],
"gap": 4,
"align": "start",
"w": "=w-106",
"children": [
{
"el": "text",
"text": "$item.name",
"size": 30,
"weight": 600,
"font": "mono",
"color": "muted"
},
{
"el": "text",
"text": "$item.text",
"size": 42,
"weight": 600,
"color": "$ink",
"maxW": "=w-180"
}
]
}
]
}
}
]
}