StatusChip data
A small status pill with a spinner and a verb that changes as the work moves on: Thinking, Cutting, Done.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| verbs* | list of string | ||
| hold | number (0.3 to 10) | 1.1 | |
| size | number (20 to 160) | 44 | |
| 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 |
| spinner | shape |
| verb | text |
Example#
{"el": "StatusChip", "verbs": ["Thinking", "Cutting", "Captioning", "Done"]}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",
"local": true,
"surface": "chip",
"dir": "row",
"gap": "=size*0.4",
"align": "center",
"motion": [{"do": "enter", "from": "pop", "curve": "bouncy"}],
"children": [
{
"el": "shape",
"id": "spinner",
"kind": "ring",
"w": "=size*0.9",
"h": "=size*0.9",
"stroke": "$accent",
"strokeW": "=size*0.12",
"fill": "transparent",
"progress": 0.7,
"motion": [{"do": "drive", "pose": {"rotate": "=lt*320"}}]
},
{
"el": "box",
"dir": "stack",
"align": "start",
"justify": "start",
"children": [
{
"$each": "$verbs",
"node": {
"el": "text",
"id": "verb",
"text": "$item",
"size": "$size",
"weight": 600,
"color": "$ink",
"motion": {
"$if": "=index<count-1",
"then": [
{"do": "during", "at": "=index*hold", "until": "=(index+1)*hold"},
{
"do": "enter",
"from": {"y": 44, "opacity": 0, "blur": 6},
"at": "=index*hold",
"curve": "punchy"
},
{
"do": "exit",
"to": {"y": -44, "opacity": 0},
"at": "=(index+1)*hold-0.18",
"curve": {"ease": "in", "duration": 0.18}
}
],
"else": [
{
"do": "enter",
"from": {"y": 44, "opacity": 0, "blur": 6},
"at": "=index*hold",
"curve": "punchy"
}
]
}
}
}
]
}
]
}