> ## 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.

# onFormChange

> Triggered whenever the swap form values change.

The `onFormChange` event fires whenever the user modifies the swap form — for example, when changing the asset, amount, or destination network.

```tsx theme={null}
<LayerswapWidget
  config={widgetConfig}
  callbacks={{
    onFormChange: (formData) => {
      console.log("Form updated:", formData)
    },
  }}
/>
```

### Callback Argument Value

```TypeScript theme={"system"} theme={null}
formData: {
  from?: string;
  to?: string;
  fromAsset?: string;
  toAsset?: string;
  amount?: string;
  destination_address?: string;
  refuel?: boolean;
}
```
