> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-xpanse/dashboards-and-reports/widget-library.md).

# Widget Library

Widgets are visual components that populate dashboards and reports with specific data in various formats such as graphs, pie charts, and text. Cortex Xpanse comes with dozens of existing widgets that you can drop into any dashboard and report. You can also create your own custom widgets.

The widget library displays both the predefined widgets and user-created custom widgets. From the Widget Library page in Expander, you can create, edit, and delete your own custom widgets based on XQL queries. Go to **Dashboards** → **Widget Library** to access the **Widget Library**.

## Create a custom XQL widget

Perform these steps to create a new custom widget.

1. In Cortex Xpanse , navigate to Dashboards → **Widget Library**.
2. In the widget menu, **Create custom XQL widget**.
3. Enter a widget **Name** and optional **Description**.
4. Create an XQL query. Select **XQL Helper** to view XQL search and schema examples.
5. **Generate** the XQL query to display the search results.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><h3>Note</h3><p>XQL queries generated from the widget library do not appear in the Query Center. The results are used only for creating the custom widget.</p></div>
6. In the **Widget** section, define how you want to visualize the results.
7. After you are happy with the query parameters and visualization definitions, **Save widget**.

   The custom widget will appear in the list of existing widgets, so you can include it in a [dashboard](/cortex-xpanse/dashboards-and-reports/dashboards.md)or [report](/cortex-xpanse/dashboards-and-reports/reports.md).

## Edit a custom widget

Perform these steps to edit or delete an existing custom XQL widget.

1. In Cortex Xpanse , navigate to Dashboards → **Widget Library**.
2. Search or scroll to locate the custom widget.
3. Mouse over the widget and select **Update widget** (![pencil-icon.png](/files/Ax5aGemFWtYWUbDcMYYY)) to edit the widget or **Delete widget from library**.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><h3>Note</h3><p>Editing an existing widget affects all dashboards that include the widget and future generated reports.</p></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-xpanse/dashboards-and-reports/widget-library.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
