Vector
Wrapper for the Figma Vector.
Props
Prop | Type | Default | Note |
---|---|---|---|
name | String | The name to be displayed in the Figma Layers List | |
vectorPaths | VectorPath | ||
vectorNetwork | VectorNetwork | ||
handleMirroring | HandleMirroring | ||
style | Style | Not all props | |
onSelectionEnter | Function | Selection enter event callback | |
onSelectionLeave | Function | Selection leave event callback | |
onLayout | Function | Event is fired once the layout has been calculated | |
onNodeId | Fuction | Getting Figma Node ID callback |
Also, most of the VectorNode fields are supported as props.
Example
<Vector
vectorNetwork={{
// The vertices of the triangle
vertices: [{ x: 0, y: 100 }, { x: 100, y: 100 }, { x: 50, y: 0 }],
// The edges of the triangle. The index refers to the vertices array.
segments: [
{
start: 0,
end: 1
},
{
start: 1,
end: 2
},
{
start: 2,
end: 0
}
],
// The loop that forms the triangle. Each loop is a
// sequence of indices into the segments array.
regions: [{ windingRule: 'NONZERO', loops: [[0, 1, 2]] }]
}}
style={{ backgroundColor: '#ff0000' }}
/>