BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/requestnetwork/payment-widget

Payment Widget

requestnetwork/payment-widget
FreeComponent

A wallet-connected payment widget for Request Network using pure wagmi

Install it

npx shadcn@latest add https://ui.request.network/r/payment-widget.json

Source

registry/default/payment-widget/payment-widget.tsxui.request.network/r/payment-widget.json
1"use client";
2
3import { type PropsWithChildren, useState } from "react";
4import { Button } from "@/components/ui/button";
5import { ConnectionHandler } from "./components/connection-handler";
6import { Web3Provider } from "./context/web3-context";
7import { PaymentModal } from "./components/payment-modal";
8import { PaymentWidgetProvider } from "./context/payment-widget-context/payment-widget-provider";
9import type { PaymentWidgetProps } from "./payment-widget.types";
10import { ICONS } from "./constants";
11import { usePaymentWidgetContext } from "./context/payment-widget-context/use-payment-widget-context";
12
13function PaymentWidgetInner({ children }: PropsWithChildren) {
14 const [isModalOpen, setIsModalOpen] = useState(false);
15 const handleModalOpenChange = (open: boolean) => {
16 setIsModalOpen(open);
17 };
18
19 const {
20 walletAccount,
21 paymentConfig: { rnApiClientId, supportedCurrencies },
22 } = usePaymentWidgetContext();
23
24 let isButtonDisabled = false;
25
26 if (!rnApiClientId || rnApiClientId === "") {
27 console.error("PaymentWidget: rnApiClientId is required in paymentConfig");
28
29 isButtonDisabled = true;
30 }
31
32 if (supportedCurrencies.length === 0) {
33 console.error(
34 "PaymentWidget: supportedCurrencies is required in paymentConfig",
35 );
36
37 isButtonDisabled = true;
38 }
39
40 return (
41 <div className="inline-flex flex-col items-center">
42 <Button
43 disabled={isButtonDisabled}
44 onClick={() => {
45 if (isButtonDisabled) return;
46 setIsModalOpen(true);
47 }}
48 variant="ghost"
49 className="p-0 h-auto bg-transparent hover:bg-transparent"
50 >
51 {children || "Pay with crypto"}
52 </Button>
53
54 <div className="flex items-center gap-1 mt-2 text-xs text-muted-foreground">
55 {/** biome-ignore lint/performance/noImgElement: This is a ShadCN library, we can't enforce next syntax on everybody */}
56 <img
57 src={ICONS.requestNetwork}
58 alt="Request Network"
59 width={10}
60 height={10}
61 className="flex-shrink-0"
62 />
63 <span>Powered by Request Network</span>
64 </div>
65
66 {walletAccount !== undefined ? (
67 <PaymentModal
68 isOpen={isModalOpen}
69 handleModalOpenChange={handleModalOpenChange}
70 />
71 ) : (
72 <ConnectionHandler
73 isOpen={isModalOpen}
74 handleModalOpenChange={handleModalOpenChange}
75 paymentModal={
76 <PaymentModal
77// … truncated

What it pulls in

npm packages

  • wagmi@^2.16.9
  • viem@^2.37.3
  • @tanstack/react-query@^5.86.0
  • react-hook-form@^7.62.0
  • lucide-react@^0.542.0
  • html2canvas-pro@^1.5.11
  • jspdf@^3.0.3

Other registry items

  • button
  • dialog
  • input
  • label
  • radio-group

Files it writes

  • registry/default/payment-widget/payment-widget.tsx
  • registry/default/payment-widget/context/payment-widget-context/index.ts
  • registry/default/payment-widget/context/payment-widget-context/payment-widget-provider.tsx
  • registry/default/payment-widget/context/payment-widget-context/use-payment-widget-context.ts
  • registry/default/payment-widget/components/connection-handler.tsx
  • registry/default/payment-widget/components/wallet-connect-modal.tsx
  • registry/default/payment-widget/components/payment-modal.tsx
  • registry/default/payment-widget/components/currency-select.tsx
  • registry/default/payment-widget/components/buyer-info-form.tsx
  • registry/default/payment-widget/components/payment-confirmation.tsx
  • registry/default/payment-widget/components/disconnect-wallet.tsx
  • registry/default/payment-widget/components/payment-success.tsx
  • registry/default/payment-widget/payment-widget.types.ts
  • registry/default/payment-widget/constants.ts
  • registry/default/payment-widget/utils/wagmi.ts
  • registry/default/payment-widget/utils/payment.ts
  • registry/default/payment-widget/utils/currencies.ts
  • registry/default/payment-widget/utils/receipt.ts
  • registry/default/payment-widget/utils/chains.ts
  • registry/default/payment-widget/hooks/use-payment.ts
  • registry/default/payment-widget/types/index.ts
  • registry/default/payment-widget/context/web3-context.tsx
  • registry/default/payment-widget/components/receipt/receipt-template.tsx
  • registry/default/payment-widget/components/receipt/styles.css
  • lib/utils.ts
  • registry/default/payment-widget/README.md

Facts

Registry
requestnetwork
Type
registry:component
Access
Free
Files written
26
Licence
the repository states none
First indexed
2026-08-04
Last confirmed
today

Go to the source

ui.request.network RequestNetwork/ui-registry on GitHub Raw registry item This item as JSON
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex