> ## Documentation Index
> Fetch the complete documentation index at: https://dynamic-docs-feat-sidebar-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# useOnramp

### Summary

This hook can be used to trigger an Onramp UI so that users can immediately buy crypto with fiat.

### How it works

After setting up your [onramp provider](/money-and-funding/fund-from-external-wallet), you can use the useOnramp to prompt your user to fund their wallet.

The following attributes are exposed:

| Method  | Type                                                                                     | Description                                                                                                                                                                  |
| ------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| enabled | `boolean`                                                                                | Whether some onramp method is enabled and ready to use.                                                                                                                      |
| open    | `(props: { address?: string; token?: string; onrampProvider: OnrampProviders }) => void` | Trigger the onramp UI with required onrampProvider attribute and optional `address` and `token` attributes, returns a Promise that will resolve once the onramp UI is closed |

### Example

Custom onramp button:

```tsx
import { useOnramp } from '@dynamic-labs/sdk-react-core'
import { OnrampProviders } from '@dynamic-labs/sdk-api-core'

const FundMyWalletButton = () => {
  const { enabled, open } = useOnramp()

  const onClick = () => {
    open({
      onrampProvider: OnrampProviders.Banxa,
      token: 'USDT',
      address: '0x1234567890123456789012345678901234567890',
    }).then(() => window.alert('Success!'))
  }

  return (
    <button onClick={onClick} disabled={!enabled}>
      Buy USDT
    </button>
  )
}
```
