Skip to content

DrawPath

Draws a custom SVG-like path on the canvas.

Usage

tsx
import { Canvas, DrawPath } from 'flexium/canvas';

<Canvas width={200} height={200}>
  <DrawPath
    d="M 10 10 L 50 10 L 30 50 Z"
    fill="purple"
    stroke="black"
  />
</Canvas>

Props

PropTypeDescription
dstring | Signal<string>The path data (SVG format).
fillstring | Signal<string>The fill color.
strokestring | Signal<string>The stroke color.
strokeWidthnumber | Signal<number>The width of the stroke.
opacitynumber | Signal<number>Opacity (0 to 1).

Interactive Demo

Released under the MIT License.