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

# Withdraw component

> Move ERC20 funds between wallets or chains with automatic routing and fee handling.

The `Withdraw` component handles outbound crypto-to-crypto fund flows. Users specify an amount and destination; the SDK handles routing, fee calculation, and execution.

<Note>
  Withdraw is currently crypto to crypto only. Fiat off-ramps are not yet supported; once available, the destination will be able to settle to a bank account, card, or cash network through this same component.
</Note>

## Basic usage

```tsx theme={null}
import { Withdraw } from "0xtrails";

// Open UI, user fills in amount and destination
<Withdraw apiKey="YOUR_API_KEY" />
```

## Pre-configured withdrawal

```tsx theme={null}
<Withdraw
  apiKey="YOUR_API_KEY"
  from={{
    token: "USDC",
    chain: "polygon",
  }}
  to={{
    recipient: "0xDESTINATION_ADDRESS",
    token: "USDC",
    chain: "ethereum",
  }}
  onWithdrawSuccess={(result) => console.log("Withdrawn:", result)}
/>
```

## ENS resolution

The `to.recipient` field accepts `.eth` ENS names and resolves them automatically:

```tsx theme={null}
<Withdraw
  apiKey="YOUR_API_KEY"
  to={{
    recipient: "vitalik.eth",
    token: "USDC",
    chain: "ethereum",
  }}
/>
```

## Props reference

| Prop                 | Type             | Required | Description                                        |
| -------------------- | ---------------- | -------- | -------------------------------------------------- |
| `apiKey`             | string           | Yes      | Your API key                                       |
| `from.token`         | string           | No       | Source ERC20 symbol or address                     |
| `from.chain`         | string \| number | No       | Source chain                                       |
| `from.amount`        | string           | No       | Pre-fill amount to withdraw                        |
| `from.walletAddress` | string           | No       | Source wallet address                              |
| `to.recipient`       | string           | No       | Destination address or ENS name                    |
| `to.token`           | string           | No       | Destination ERC20 symbol or address                |
| `to.chain`           | string \| number | No       | Destination chain                                  |
| `to.calldata`        | string           | No       | ABI-encoded calldata to execute at the destination |
| `onWithdrawStart`    | function         | No       | Called when the user begins                        |
| `onWithdrawSuccess`  | function         | No       | Called on completion                               |
| `onWithdrawError`    | function         | No       | Called on failure                                  |

For appearance and wallet options, see [SDK configuration](/cross-chain/sdk/configuration).
