FabricJS Articles

Page 26 of 51

How to create a Triangle with border colour using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 272 Views

In this tutorial, we are going to create a Triangle with border colour using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. Since FabricJS is extremely flexible, we are allowed to customize our Triangle object in any way we like. One of the properties that FabricJS provides is borderColor which allows us to manipulate the colour of the border when our object is active. Syntax new fabric.Triangle({ borderColor: String }: Object) ...

Read More

How to create a Triangle with crosshair cursor on moving objects using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 286 Views

In this tutorial, we are going to create a Triangle with a crosshair cursor on moving objects using FabricJS. The crosshair is one of the native cursor styles available which can be used in the FabricJS canvas too. FabricJS provides various types of cursors like default, all-scroll, crosshair, col-resize, row-resize etc that reuse the native cursor under the hood. The moveCursor property sets the style of the cursor when the object is moved around in the canvas. This property is useful for providing visual feedback to users about the current ...

Read More

How to create a Triangle with dash pattern border using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 326 Views

In this tutorial, we are going to create a triangle with a dash pattern border using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. We can change the appearance of the dashes of border by using the borderDashArray property. However, our triangle object must have borders enabled in order for this property to work. If the hasBorders property is assigned a false value, this property will not work. Syntax new fabric.Triangle({ ...

Read More

How to disable the centered rotation of Triangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 210 Views

In this tutorial, we are going to learn how to disable the centered rotation of Triangle using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. By default, all objects in FabricJS use their center as the point of rotation. However, we can change this behaviour by using the centeredRotation property. Syntax new fabric.Triangle({ centeredRotation: Boolean }: Object) Parameters ...

Read More

How to disable the centered scaling of a Triangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 185 Views

In this tutorial, we are going to learn how to disable the centered scaling of Triangle using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. When an object is scaled via controls, assigning a True value to the centeredScaling property makes the origin of transformation its center. By setting it to False, the scaling occurs from the corner being dragged. Syntax new fabric.Triangle({ centeredScaling: Boolean }: Object) Parameters ...

Read More

How to disable the selectability of Triangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 192 Views

In this tutorial, we are going to learn how to disable selectability of a Triangle using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. In order to modify an object, we have to select it in FabricJS. However, we can disable this behaviour by using the selectable property. Syntax new fabric.Triangle({ selectable: Boolean }: Object) Parameters ...

Read More

How to flip a Triangle horizontally using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 243 Views

In this tutorial, we are going to learn how we can flip a Triangle object horizontally using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. We can flip a triangle object horizontally using the flipX property. Syntax new fabric.Triangle({ flipX: Boolean }: Object) Parameters Options (optional) − This parameter is an Object which provides additional customizations to our ...

Read More

How to flip a Triangle vertically using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 235 Views

In this tutorial, we are going to learn how we can flip a Triangle object vertically using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. We can flip a triangle object vertically using the flipY property. Syntax new fabric.Triangle({ flipY: Boolean }: Object) Parameters Options (optional) − This parameter is an Object which provides additional customizations to our ...

Read More

How to hide the controlling borders of a Triangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 178 Views

In this tutorial, we are going to learn how to hide the controlling borders of a Triangle using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. We can customize our controlling borders in many ways such as adding a specific colour to it, a dash pattern, etc. We can also eliminate the borders completely by using the hasBorders property. Syntax new fabric.Triangle({ hasBorders: Boolean }: Object) Parameters ...

Read More

How to hide the controlling corners of a Triangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 187 Views

In this tutorial, we are going to learn how to hide the controlling corners of a Triangle using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. The controlling corners of an object allow us to increase or decrease its scale, stretch or change its position. We can customize our controlling corners in many ways such as adding a specific colour to it, changing its size, etc. We can also hide them using the hasControls ...

Read More
Showing 251–260 of 506 articles
« Prev 1 24 25 26 27 28 51 Next »
Advertisements