> For the complete documentation index, see [llms.txt](https://cbwire.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cbwire.ortusbooks.com/3.x/how-it-works.md).

# How It Works

This diagram references the Counter we created in the [Introduction](/3.x/master.md) and shows how CBWIRE achieves reactive UI components with zero page refreshing.

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

1. The user requests a page from the server that includes our Counter component.
2. ColdBox receives the request.
3. CBWIRE parses our component and initially renders it with its default values.&#x20;
4. The rendered component is sent to the browser.\
   \&#xNAN;***It's important to understand that nothing extraordinary has happened at this point. We've returned HTML to the browser from an incoming request. Next is when things get interesting.***
5. The user clicks the button.
6. CBWIRE intercepts the user's click client-side and sends an XHR request to the server.
7. CBWIRE runs the increment() method, updating the data properties.
8. CBWIRE re-renders the template.
9. CBWIRE returns the re-rendered template to the browser.
10. CBWIRE uses Livewire's DOM diffing technology to update the component on the page.


---

# 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://cbwire.ortusbooks.com/3.x/how-it-works.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.
