Line

Wrapper for the Figma Line.

Props

PropTypeDefaultNote
nameStringThe name to be displayed in the Figma Layers List
strokeWeightNumber
strokesArray of Paint
styleStyleNot all props
onSelectionEnterFunctionSelection enter event callback
onSelectionLeaveFunctionSelection leave event callback
onLayoutFunctionEvent is fired once the layout has been calculated
onNodeIdFuctionGetting Figma Node ID callback

Also, most of the LineNode fields are supported as props.

Example

<Line
name="line"
strokeWeight={4}
strokeAlign="CENTER"
opacity={0.5}
strokes={[{ type: 'SOLID', color: { r: 1, g: 0, b: 1 } }]}
strokeCap="ROUND"
dashPattern={[2, 10, 2, 10]}
/>