If you need to create a custom shape with HTML5 Canvas, first you have to create a path and then close it using the closePath() method. Use the lineTo(), arcTo(), quadraticCurveTo(), or bezierCurveTo() methods to construct each subpath which makes up your shape.
If you want to create a rectangle using HTML5 Canvas, you can use the rect() method.
x and y parameters is used for positioning and height and width parameters are used for sizing an HTML5 Canvas rectangle. Also the rectangle is positioned about its top left corner.