Docs

TransactionButton

TransactionButton component is used to render a button that triggers a transaction.

  • It shows a "Switch Network" button if the connected wallet is on a different chain than the transaction.

Example

<TransactionButton
transaction={() => {}}
onSuccess={handleSuccess}
onError={handleError}
>
Confirm Transaction
</TransactionButton>;

Customize the styling by passing the unstyled prop and your inline styles and/or classes:

<TransactionButton
transaction={() => {}}
onSuccess={handleSuccess}
onError={handleError}
unstyled
className="bg-white text-black rounded-md p-4 flex items-center justify-center"
>
Confirm Transaction
</TransactionButton>;

Parameters

Returns