Skip to main content

HTML5 canvas Circle Tutorial

To create a circle shape with Konva, we can instantiate a Konva.Circle() object.

For full list of properties and methods, see the Circle API Reference.

import Konva from 'konva';

const stage = new Konva.Stage({
container: 'container',
width: window.innerWidth,
height: window.innerHeight
});

const layer = new Konva.Layer();
stage.add(layer);

const circle = new Konva.Circle({
x: stage.width() / 2,
y: stage.height() / 2,
radius: 70,
fill: 'red',
stroke: 'black',
strokeWidth: 4
});

layer.add(circle);