Nova · Composition
Stacking
with takes a list. Each fragment wraps what the ones before it made, so the last one named ends up outermost.
{
canvases: [
{
id: 'stacking.main',
initial: {
action: 'stacking.core',
with: ['stacking.inner', 'stacking.outer'],
},
},
],
actions: {
stacking.core: {
id: 'stacking.core',
layout: { component: 'Text', children: 'the action' },
},
},
fragments: {
stacking.inner: {
kind: 'fragment',
id: 'stacking.inner',
layout: {
component: 'Stack',
children: [
{ component: 'Text', children: 'inner begins' },
{ slot: 'body' },
{ component: 'Text', children: 'inner ends' },
],
},
},
stacking.outer: {
kind: 'fragment',
id: 'stacking.outer',
layout: {
component: 'Stack',
children: [
{ component: 'Text', children: 'outer begins' },
{ slot: 'body' },
{ component: 'Text', children: 'outer ends' },
],
},
},
},
}outer begins
inner begins
the action
inner ends
outer ends
Nothing. It is only drawn.
{ stacking.main: ['stacking.core'] }outer begins inner begins the action inner ends outer ends
Left: the action as the package ships it. Right: the same action running in this page, rendered with this site’s components. Below: the action run as the example specifies, on the installed package.