PromptBox data
A prompt box: the question types itself in, with tool chips and a send button under it.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| text* | string | ||
| chips | list of string | ["Search","Create"] | |
| w | number (300 to 1800) | 980 | |
| cps | number (1 to 200) | 16 | |
| delay | number (0 to 60) | 0.5 | |
| accent | color | "accent" | |
| fill | color | "paper" | |
| 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 |
| box | box |
| query | text |
| chip | box |
| send | box |
Example#
{"el": "PromptBox", "text": "Cut this talk down to 30 seconds"}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",
"id": "box",
"w": "$w",
"fill": "$fill",
"radius": 30,
"pad": [34, 40],
"gap": 40,
"align": "stretch",
"shadow": 3,
"children": [
{
"el": "text",
"id": "query",
"text": "$text",
"size": 46,
"weight": 500,
"font": "body",
"color": "$ink",
"motion": [{"do": "type", "cps": "$cps", "delay": "$delay", "cursor": true}]
},
{
"el": "box",
"dir": "row",
"justify": "between",
"align": "center",
"children": [
{
"el": "box",
"dir": "row",
"gap": 14,
"align": "center",
"children": [
{
"$each": "$chips",
"node": {
"el": "box",
"id": "chip",
"radius": 999,
"pad": [8, 22],
"border": "rgba(128,128,140,.4)",
"borderW": 2,
"children": [
{
"el": "text",
"text": "$item",
"size": 26,
"weight": 500,
"font": "body",
"color": "muted"
}
]
}
}
]
},
{
"el": "box",
"id": "send",
"dir": "stack",
"w": 68,
"h": 68,
"radius": 999,
"fill": "$accent",
"children": [{"el": "icon", "name": "arrow", "size": 34, "color": "white", "rotate": -90}]
}
]
}
]
}