Add label to custom elements in customModeler

I need to add a label to one of my custom element, I tried everything but got nothing. Anyone can give me some hints, thanks.


const customElement = 

    type: "custom:triangle",

    id: "CustomTriangle_1",

    x: 30,

    y: 100,

    width: 30,

    height: 30,



const bpmnModeler = new CustomModeler({...});


CustomModeler.prototype.addCustomShape = function(customElement) {


    const canvas = this.get('canvas');

    const elementFactory = this.get('elementFactory');

    const customAttrs = assign({businessObject: customElement}, customElement);

    const customShape = elementFactory.create('shape', customAttrs);

    //how to add label here

    return canvas.addShape(customShape);


What is your extension use case? First of all we need to make sure you’re headed in the right direction. Almost all extension use cases don’t require custom shapes.

Thanks for your answer. Then reason I want to use custom shape is I have disabled contextPadProvider and paletteProvider. I only use code to draw all elements. So I want to add a custom button to let user to create task or gateway and so on. When user click this button, a popup window will show, and user can detect next step to do in this window.1