Skip to content

BezierCurve

The <BezierCurve> primitive renders SVG Bezier curves — either quadratic (one control point) or cubic (two control points). It supports progressive draw animations with accurate length approximation, making it perfect for smooth paths, flow diagrams, and organic shapes.

0.00s / 3.97s · F0
PropTypeDefaultDescription
x1numberStart point X
y1numberStart point Y
cx1numberFirst control point X
cy1numberFirst control point Y
cx2numberundefinedSecond control point X (makes it cubic)
cy2numberundefinedSecond control point Y (makes it cubic)
x2numberEnd point X
y2numberEnd point Y
strokestring'#fff'Stroke color
strokeWidthnumber2Width of the stroke
fillstring'none'Fill color
strokeDasharraystringundefinedDash pattern (e.g. "6 3")
opacitynumber1Opacity from 0 to 1
  • Quadratic: Provide x1, y1, cx1, cy1, x2, y2 — one control point, simpler curves
  • Cubic: Also provide cx2, cy2 — two control points, S-curves and more complex shapes
import { Player, Draw, BezierCurve } from '@elucim/core';
{/* Quadratic Bezier — one control point */}
<Player width={500} height={300} fps={30} durationInFrames={90}>
<Draw duration={40}>
<BezierCurve
x1={50} y1={250} cx1={250} cy1={30} x2={450} y2={250}
stroke="#6c5ce7" strokeWidth={3}
/>
</Draw>
</Player>
{/* Cubic Bezier — two control points */}
<Player width={500} height={300} fps={30} durationInFrames={90}>
<Draw duration={40}>
<BezierCurve
x1={50} y1={150} cx1={150} cy1={20} cx2={350} cy2={280} x2={450} y2={150}
stroke="#ff6b6b" strokeWidth={3}
/>
</Draw>
</Player>