# Add Context Menu Item

A tutorial showing how to add a context menu item in the SpreadJS Designer Component, including UI and code examples

## Content

Follow the below steps to add the 'Insert Signature' option in the context menu component.

1. Access the default configuration.

    ```JavaScript
    // Access the default config
    var config = GC.Spread.Sheets.Designer.DefaultConfig;
    ```
2. Add the "Insert Signature" option in the `contextMenu` tag and set it into commandMap in your project.

    ```JavaScript
    // Add context menu item in config context menu
    if (config && config.contextMenu) {
        config.contextMenu.unshift("insertSignatureMenu");
    }
    
    // Create command for the new context menu item
    config.commandMap = {
        "insertSignatureMenu": {
            text: "Insert Signature",
            commandName: "insertSignatureMenu",
            visibleContext: "ClickRowHeader",
    
            // execute InsertSignature, following just a simple demo code snippet
            execute: () => {
                console.log("Insert Signature");
            }   
        }
    }
    ```
3. Initialize the designer instance by passing the `config` parameter for customizable configuration.

    ```JavaScript
    // Initialize the designer instance
    var designer = new GC.Spread.Sheets.Designer.Designer("designerHost", config);
    ```

The below output will be generated:
![image](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/image.b1eb1b.png?width=300)