> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/lwc-components/build-with-ai/prompt-library.md).

# Prompt Library

Copy an Avonni LWC prompt, see the expected result, and check the generated code against your package and Salesforce org. Start with an Account table.

<a href="https://docs.avonnicomponents.com/lwc-components/build-with-ai/setup.md" class="button secondary" data-icon="plug">Set up MCP and Skills</a>

## Build and check an Account table

Start with [Data Driven Data Table, Example 1: Query mode](https://docs.avonnicomponents.com/lwc-components/data-driven-components/datatable.md#example-1-query-mode). You need the Avonni package, a user license, and Account records you can access.

<figure><img src="https://2403786217-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPjQbBtFNxVSSOtnsjuwx%2Fuploads%2FS4ctVM7rB1kzYyrtldlG%2Fdd-datatable-example-query.png?alt=media" alt="Reference Account table with search and filters above Name, Industry, and Annual Revenue columns"><figcaption><p>Reference example with sample Accounts. Your rows depend on your org's data and permissions. <a href="https://2403786217-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPjQbBtFNxVSSOtnsjuwx%2Fuploads%2FS4ctVM7rB1kzYyrtldlG%2Fdd-datatable-example-query.png?alt=media">Open the full-size image</a>.</p></figcaption></figure>

### Copy this prompt

{% code overflow="wrap" %}

```
In my Salesforce DX project, build an LWC with
avonni-dd-datatable in query mode for Account records.
Follow "Data Driven Data Table, Example 1: Query mode"
in the Avonni LWC Components documentation.

Show Name, Industry, and AnnualRevenue. Search by Name.
Add Industry and BillingState filters, sorting, and pagination.
Make AnnualRevenue editable.

Use Avonni MCP to check the component API and column type.
Compare them with my installed package version. If you cannot
check my org, version, or field access, tell me what to verify.

Save edits with Salesforce updateRecord. Show save errors and
refresh the table after a successful save. Show changed files
and steps to deploy and test them. Do not deploy.
```

{% endcode %}

**Expected result:** Search, filters, sorting, and pagination work. An Annual Revenue edit remains after reloading the page. The reference save handler is a placeholder; the assistant must implement persistence.

### Check it in your org

1. Confirm the installed package version and your Avonni license.
2. Confirm you can read Accounts and the example fields, and edit Annual Revenue.
3. Try search, both filters, sorting, and pagination when enough rows exist.
4. Save an Annual Revenue edit and reload. Trigger a save error and confirm it appears.

If a check fails, give the assistant the exact error, package version, and relevant field access details.

## More starting prompts

Replace the objects, fields, and desired result. Ask the assistant to check the Avonni API before editing code.

{% tabs %}
{% tab title="Views" %}

> Add a Kanban of Opportunities grouped by stage, with drag and drop between columns.

> Add a Timeline of the record's Tasks and Events, newest first.

> Add a Map of my Accounts as markers with the list view below the map.
> {% endtab %}

{% tab title="UI" %}

> Build my component's header with an Avonni Header, an Avatar Group of the account team, and an action button.

> Add a Visual Picker so the user chooses a plan, and store the selection.

> Add a Signature Pad and save the signature when the user confirms.

> Replace my custom progress display with an Avonni Progress Indicator driven by the current step.
> {% endtab %}

{% tab title="Events" %}

> Handle the Data Table's row action event and navigate to the record.

> When the Combobox selection changes, refresh the List below it with the selected account's contacts.

> Open the record page when the user clicks a Kanban card.
> {% endtab %}

{% tab title="Styles/API" %}

> Restyle the Card to match our brand: rounded corners, light gray header, and our primary color on actions.

> Make the Data Table denser and align the amount column to the right.

> Show me the type definition for the Data Table columns attribute and generate a valid columns array for Case records.

> What utility functions ship with the library, and how do I use them in my component?
> {% endtab %}
> {% endtabs %}


---

# 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://docs.avonnicomponents.com/lwc-components/build-with-ai/prompt-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.
