> For the complete documentation index, see [llms.txt](https://docs.overflowcms.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overflowcms.com/webflow-integration/rendering-events-and-animations.md).

# Rendering Events & Animations

## Rendering Events & Animations

The embed script dispatches real DOM `CustomEvent`s so your Webflow interactions, GSAP timelines, or ScrollTrigger instances can react to content that didn't exist when the page first loaded.

### `oc:rendered`

Dispatched on the **list container** (the `[data-oc-list]` element) once per page load — including every "Load more" click. Bubbles.

```js
document.addEventListener('oc:rendered', (e) => {
  console.log(e.detail.page, e.detail.total);
  // e.detail: { page: number, total: number }
});
```

Use this to re-run a ScrollTrigger `.refresh()` after new items land, or to know when a given list has finished its first render.

### `oc:item-rendered`

Dispatched on **each individual item node** right after its fields are bound, before it's inserted relative to the load-more button. Bubbles, so you can listen once at the container or document level instead of per-item.

```js
document.addEventListener('oc:item-rendered', (e) => {
  const { item } = e.detail; // the raw PublishedItem: { id, slug, collection, publishedAt, data }
  gsap.from(e.target, { opacity: 0, y: 20, duration: 0.4 });
});
```

### Practical pattern

Because items can arrive well after the page's initial load (first render, then again on every "Load more"), don't wire animations in a plain `DOMContentLoaded` handler expecting the items to already be there — listen for `oc:item-rendered` instead, or re-run your init logic inside an `oc:rendered` handler.


---

# 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://docs.overflowcms.com/webflow-integration/rendering-events-and-animations.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.
