> 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

Create, search, and view custom widgets in Cortex Xpanse, or use predefined widgets.

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](https://2229240073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F02CCMTnqc4fWJkdEuCs8%2Fuploads%2Fgit-blob-e7c0668cabfca900e36a5d9bdb176c0bb55d81c6%2Fe57ef37061940e6864a0fcd6310e1a4daeb73ce23d98ab0913b4dd239eb6ffcb.png?alt=media)) 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
