Skip to content

DrawCircle

Draws a circle on the canvas.

Usage

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

<Canvas width={200} height={200}>
  <DrawCircle
    x={100}
    y={100}
    radius={50}
    fill="orange"
  />
</Canvas>

Props

PropTypeDescription
xnumber | Signal<number>The x-coordinate of the center.
ynumber | Signal<number>The y-coordinate of the center.
radiusnumber | Signal<number>The radius of the circle.
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.