Skip to content

Examples

Simple

Intercepting clicks on links, displaying a loader and updating the targets' content.

Form

In the following example, we intercept a form submission, display a loader and use a custom view transition to animate only the updated content once the request is finished.

Modes

Modes are configured with the data-option-mode attribute.

Add to cart / Quickbuy

Error handling

Cancelling a request

Use the abort method to cancel a request. In the following example, we use the Action component to cancel any pending request from any mounted Fetch component.

TIP

In this example, we could use a more specific version of the data-option-target attribute of the Action component to target a single Fetch instance.