# Generating a menu template

Menus are created using a **menu template**, which defines the structure and behavior of the menu in a JSON format.

You can generate a template in two ways. The first option is to build the JSON template using the tool at [**www.deskifier.com/menugenerator**](http://www.deskifier.com/menugenerator). The second option is to create and manage menu templates directly from the **Deskifier dashboard UI**.

Once a template has been created, you can reference it in your application by providing the **template ID** when creating a menu. This allows you to reuse and manage menu configurations without needing to define them manually in your workflows.

Here's an example menu built in the Menu Generator

<figure><img src="/files/oKWfgbFQVlO55cH3lOt5" alt=""><figcaption></figcaption></figure>

And the code output:

```json
[
    {
        "type": "submenu",
        "id": "id-xpzkrg3vb",
        "label": "Example 1",
        "submenu": [
            {
                "type": "normal",
                "id": "id-cnvvcywud",
                "label": "Example Item 1",
                "role": "about"
            },
            {
                "type": "normal",
                "id": "id-cotty37iv",
                "label": "Example Item 2",
                "role": "quit"
            }
        ]
    },
    {
        "type": "submenu",
        "id": "id-b0rxg0v69",
        "label": "Example 2",
        "submenu": [
            {
                "type": "normal",
                "id": "id-rxcmihlgc",
                "label": "Example Item 3",
                "role": "undo"
            },
            {
                "type": "normal",
                "id": "id-ojtrcuwar",
                "label": "Example Item 4",
                "role": "redo",
                "accelerator": "CmdOrCtrl+Alt+N"
            }
        ]
    }
]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://deskifier.gitbook.io/deskifier/deskifier-bubble.io-docs/guides-and-examples/generating-a-menu-template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
