Bento function
A grid of feature cards that assembles: the first is wide, the rest fill two rows. Each item has a title, and may have an icon and a big value.
Props#
| Prop | Type | Default | Notes |
|---|---|---|---|
| items* | list | [{title, icon?, value?}] | |
| w | number (500 to 1800) | 1500 | |
| cellH | number (120 to 600) | 250 | |
| each | number (0 to 2) | 0.1 | |
| 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 |
Example#
{
"el": "Bento",
"items": [
{"title": "Cuts", "icon": "scissors"},
{"title": "Captions", "icon": "chat"},
{"title": "Motion", "icon": "sparkle"},
{"title": "Posting", "icon": "send", "value": "1 tap"}
]
}How it is made#
This is one of the 8 components built by a short function, because it makes one node per row, scene or spoken word and data alone cannot loop like that. The function returns the same kind of tree as every other component, so what reaches the renderer is still plain elements and behaviors.