<Element />
Defines the Node for a given User Element
#
Reference#
Propsis
React.ElementTypeThe User Element to renderid
StringRequired if the <Element /> is being created inside a User Componentcanvas
booleanIf true, a Canvas Node will be created.custom
Record<string, any>Sets the Node's custom propertieshidden
booleanSets the Node's hidden property. If true, this will hide the Node...elementProps
ObjectThe props of the element specified in 'is'
#
Usage#
Configure Nodes in <Frame />Since the <Frame />
component creates a Node automatically for all of its children elements, thus the <Element />
component can be used to simply configure the values of the Node that is being created.
#
Defining Linked NodesWhen used inside a User Component, <Element />
works identically as used inside <Frame />
but because there isn't a Node in-place, thus it has to create a new Linked Node - which is essentially a Node that is linked to the Node of the containing User Component via an arbitary id
:
<Element />
used inside User Component must specify anid
prop
#
Examplescustom
properties#
Setting User Components may consume custom
properties from their corresponding Node. These properties essentially act like additional props.
Let's say we have a Hero component that has a css
custom property and as usual, we set its default values via the craft
property.
Now, if you'd like to actually set these values when you call the component, you can do it like so: