Simple Rectangle
Create a basic rectangle using theShape and Rect components. The fill prop accepts an RGBA color array where each value is 0-255.
Circle
Draw a perfect circle using theCircle component with the radius prop.
Ellipse
Create an ellipse by using different horizontal and vertical radii withrx and ry props.
Rounded Rectangle
Add rounded corners to rectangles using therx and ry props.
- Tab Title
- Tab Title
Fill and Stroke
Combine fill and stroke colors to create outlined shapes.- Tab Title
- Tab Title
- Tab Title
Multiple Shapes
Combine multiple shapes in a single canvas.Using GlCanvas
All examples can also useGlCanvas for hardware-accelerated rendering.
SwCanvas, but GlCanvas uses WebGL for rendering and requires a locateFile function to load the WASM module.
Opacity
Control transparency with theopacity prop (0-255, where 255 is fully opaque).