> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layerswap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Events Introduction

> Subscribe to widget events and receive swap status updates

Events provide a way to receive updates on the status of swaps and handle errors through custom callbacks.

You do not need to import anything extra to make use of event callbacks, instead simply add them using the events field inside the settings prop on LayerswapProvider.

```jsx theme={null}
<LayerswapProvider
    callbacks={{
      // events callbacks go here
    }}
>
  ...
</LayerswapProvider>
```

[**onFormChange**](/integration/UI/Widget/EventCallbacks/onFormChange): Called whenever the swap form values change — for example, when the user updates the asset, amount, or destination network.

[**onSwapCreate**](/integration/UI/Widget/EventCallbacks/onSwapCreate): Called when a new swap is successfully created after submitting the form.

[**onSwapComplete**](/integration/UI/Widget/EventCallbacks/onSwapComplete): Called when a swap completes successfully on-chain or via an integrated exchange.

[**onSwapModalStateChange**](/integration/UI/Widget/EventCallbacks/onSwapModalStateChange): Called when the swap modal is opened or closed.

[**onBackClick**](/integration/UI/Widget/EventCallbacks/onBackClick): Called when the user clicks the back button in the swap flow.
