# Jig Templates

Jigx provides a template gallery that you can use as a base when creating solutions. Jigx templates are available when creating jigs, adding components and widgets to a jig.

Using templates has many benefits, such as:

1. **Time Efficiency:** Templates provide a pre-designed structure and layout. They can save you time by eliminating the need to start from scratch or design every aspect from the ground up. With templates, you can jumpstart your development process and focus more on customizing the specific functionality you require.
2. **Consistency and Best Practices:** Templates ensure consistency in your project. Using templates helps maintain a uniform structure, coding style, and user experience throughout your application.
3. **Reduced Development Effort:** Templates include pre-built features and components that are commonly required when building Jigx Apps. By leveraging these pre-existing elements, you can reduce the effort needed to implement standard features, allowing you to allocate more time and resources to develop unique and critical features that differentiate your app.

{% hint style="info" %}
While templates offer numerous benefits, it's important to remember that they may not always meet your requirements. Customization is still necessary, and templates should be used as a starting point rather than a complete solution.
{% endhint %}

<figure><img src="/files/GGARu4rvGsNIfkJaCGcI" alt="Jig template"><figcaption><p>Jig template</p></figcaption></figure>

### Using jig templates

{% embed url="<https://youtu.be/Sn0YICgtS60>" %}

{% hint style="info" %}
Jig templates either use [Static Data](https://docs.jigx.com/examples/static) or [Dynamic Data](/building-apps-with-jigx/data/data-providers/dynamic-data.md). You can easily customize the template to use other [datasources](/administration/solutions/data.md) instead.&#x20;
{% endhint %}

Each jig type has a set of templates to choose from. Follow the steps below to select a template.

1. In Explorer in the **jigs** folder, right-click and create a new jig file with the .jigx extension. The Jigx IntelliSense popup displays listing the available jig types and the **Use template** option. Use **ctrl+space to open the jig IntelliSense popup.**

<figure><img src="/files/MIMRdtZttJLhE3QMRpJY" alt="Jig template option"><figcaption><p>Jig template option</p></figcaption></figure>

1. Click **Use template**. The templates gallery opens providing the templates for all jig types. Use the *Search* and *Category* fields to find the template you want or browse the gallery by scrolling through the options.
2. Once you have chosen a template, hover over the template, there are two options:

**1. Insert**

<figure><img src="/files/UvAXo17ieCvSI6NINmCf" alt="Template Insert jig"><figcaption><p>Template Insert jig</p></figcaption></figure>

1. Click the blue **Insert** button. The selected template YAML will be inserted into your jig file.
2. Check the YAML code for comments that specify additional steps you must take on the template, such as *#Create new table invoices in databases/default.jigx*. Here you will manually need to add the table to the `default.jigx` file under the database folder.
3. Add your jigId to the `index.jigx` file.
4. Publish your project and view the jig in the app.
5. Now you can customize the jig by changing the static data to dynamic data or adding additional components using the component templates described below.

**2. Configure**

<figure><img src="/files/M36uKgyv2UHo0mfsV5Xg" alt="Template Configure jig"><figcaption><p>Template Configure jig</p></figcaption></figure>

1. Click the blue **Insert** button.
2. The selected template YAML will be inserted into your jig file.
3. Check the YAML code for comments that specify additional steps you must take on the template, such as *#Create new table invoices in databases/default.jigx*. Here, you will manually need to add the table to the `default.jigx` file under the database folder.
4. The`jigId` are **automatically** added to the index.jigx file.
5. Publish your solution and view the widget and jig in the app.
6. Now you can customize the jig by changing the static data to dynamic data or adding additional components using the component templates described below.

### Scenario templates

You can use the scenario templates to create a functioning solution. For example insert the **Content management** scenario template and publish out the solution to the app. The scenario includes four jigs and adds the contacts Dynamic Data table.

<figure><img src="/files/VJ5Gw87t1hUNgHL33J3E" alt="Scenario templates" width="375"><figcaption><p>Scenario templates</p></figcaption></figure>

#### See Also

* [Component Templates](/building-apps-with-jigx/ui/components-_controls_/component-templates.md)


---

# 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://docs.jigx.com/building-apps-with-jigx/ui/jigs-_screens_/jig-templates.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.
