--- url: /reference/items/FetchShopifyPartial/js-api.md --- # JS API The `FetchShopifyPartial` class extends the [`Fetch` class](../Fetch/js-api.md) and delegates fetching and DOM updates to Shopify's [`@shopify/partial-rendering`](https://www.npmjs.com/package/@shopify/partial-rendering) package when partials are configured. All [`Fetch` options](../Fetch/js-api.md#options), getters, methods and events are inherited; the additions and differences are documented below. ## Options ### `partials` * Type: `string` * Default: `''` The names of the Shopify partials to refresh, matching the names used in the corresponding `{% partial %}` tags. Provide them as a comma-separated list in the `data-option-partials` attribute; surrounding whitespace is trimmed. When empty, the component falls back to the base [`Fetch`](../Fetch/index.md) behaviour. ```html Refresh ``` ## Behaviour ### Fallback to Fetch The Shopify partial rendering path is used only when the [`partials` option](#partials) lists at least one name **and** the `@shopify/partial-rendering` package resolves. In every other case the component behaves exactly like the base [`Fetch`](../Fetch/index.md) component and swaps content by matching `id` attributes from a full response. It falls back to `Fetch` when: * no partial is configured, or the package is not installed; * the request cannot be expressed as a plain `GET` — because the partials API only fetches a URL, any request carrying a body, a non-`GET` method, custom headers or any other request option makes the component fall back so those options are not silently dropped. This covers the [`headers`](../Fetch/js-api.md#headers) / [`requestInit`](../Fetch/js-api.md#requestinit) options and [`headers[]` refs](../Fetch/js-api.md#headers-1), a `method="post"` form, and per-call overrides such as `fetch(url, { credentials: 'include' })`. Framework-internal headers are ignored, so the click, submit and history navigation flows still use partial rendering. The package is loaded lazily on the first request, so it never needs to be bundled when it is not used. ### Events `FetchShopifyPartial` emits the same [events as `Fetch`](../Fetch/js-api.md#events), with two differences on the partial rendering path: * the [`fetch-response` event](../Fetch/js-api.md#fetch-response) is **not** emitted, as there is no `Response` object to expose; * the [`fetch-update` event](../Fetch/js-api.md#fetch-update) payload carries the opaque partials `update` object (as `event.detail[0].update`) instead of a parsed `Document` fragment. On the fallback path, all events — including `fetch-response` — behave exactly like the base [`Fetch`](../Fetch/js-api.md#events) component.