React ThorVG Fiber
API Reference

Path

Custom path geometry component

Props

Prop

Type

Notes

  • Must be nested inside a Shape component
  • Use PathCommand constants: PathCommand.MoveTo, PathCommand.LineTo, PathCommand.CubicTo, PathCommand.Close
  • Commands define arbitrary vector paths
  • Useful for complex custom shapes
  • API matches the bindings appendPath method

Example

import { Shape, Path, PathCommand } from 'react-thorvg-fiber';

<Shape fill={[255, 0, 0, 255]}>
  <Path
    commands={[PathCommand.MoveTo, PathCommand.LineTo, PathCommand.Close]}
    points={[{ x: 0, y: 0 }, { x: 100, y: 100 }]}
  />
</Shape>

On this page