KeyChips data
Keyboard keys pressed one after another: a shortcut such as ⌘ K.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| keys* | list of string | ||
| size | number (30 to 400) | 110 | |
| each | number (0 to 2) | 0.18 | |
| ink | color | "ink" |
* 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 |
| key | box |
Example#
{"el": "KeyChips", "keys": ["⌘", "K"]}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",
"dir": "row",
"gap": "=size*0.22",
"align": "center",
"motion": [
{
"do": "stagger",
"each": "$each",
"motion": [{"do": "enter", "from": {"y": -30, "scale": 0.8, "opacity": 0}, "curve": "bouncy"}]
}
],
"children": [
{
"$each": "$keys",
"node": {
"el": "box",
"id": "key",
"surface": "key",
"dir": "stack",
"w": "=size*1.25",
"h": "=size*1.25",
"pad": 0,
"children": [
{
"el": "text",
"text": "$item",
"size": "=size*0.52",
"weight": 700,
"font": "mono",
"color": "$ink"
}
]
}
}
]
}