View

Analog of View component at React Native, React Sketchapp. The most fundamental component for building a UI. Component renders Figma group node if it has children, rectangle node otherwise.

Props

PropTypeDefaultNote
nameStringThe name to be displayed in the Figma Layers List
childrenNode
styleStyleSupports can be different depends on children
onSelectionEnterFunctionSelection enter event callback
onSelectionLeaveFunctionSelection leave event callback
onLayoutFunctionEvent is fired once the layout has been calculated

Also, supports fields of FrameNode as props if has children, supports fields of RectangleNode as props if has no children.

Examples

<View style={{width: 200, height: 100, backgroundColor: "red"}} />

will be displayed as rectangle.

<View>
<Text>Hello world!</Text>
</View>

will be displayed as group with nested text node.