UPI ID Input

UPI ID Input is a copy-paste React component that stops upi payment to the wrong vpa before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/upi-id-input
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsUPI payment to the wrong VPA

Was this component page useful?

How do I install UPI ID Input?

pnpm dlx shadcn@latest add @bollard/upi-id-input

The files land in your project. They're yours to edit.

How do I use UPI ID Input in React?

upi-id-input-usage.tsx
import { UpiIdInput } from "@/components/ui/upi-id-input"

<UpiIdInput key={preset} label="Pay to UPI ID" defaultValue={value} expectedName={expectedName} verify={verifyDemoUpi} />

What input mistakes does UPI ID Input catch?

  • Pasted upi://pay links, reduced to the pa address
  • Email addresses typed as UPI IDs
  • Typo'd handles, with one-tap corrections
  • App names typed as handles (@gpay → its real handles)
  • Phone-number IDs with the wrong length or a +91 prefix
  • Registered name that differs from the expected or link-claimed name

What props does UPI ID Input accept?

UpiIdInput props
PropTypeDefault
label

Visible label.

string"UPI ID"
value

Controlled UPI ID (cleaned).

string—
defaultValue

Initial UPI ID when uncontrolled.

string""
onValueChange

Called with the cleaned ID on every change; a pasted upi://pay link becomes its `pa`.

(value: string) => void—
verify

Asks your backend who the ID is registered to. Return null when it cannot confirm the ID.

(vpa: string, signal: AbortSignal) => Promise<UpiVerification | null>—
onVerifiedChange

Called with the result, or null when the ID changes or cannot be verified.

(result: UpiVerification | null) => void—
expectedName

The name the user expects to pay; a different registered name is called out.

string—
handles

Known handles. Defaults to Google Pay, PhonePe, Paytm, Amazon Pay, WhatsApp, BHIM and major banks.

Record<string, UpiHandleInfo>UPI_HANDLES
delay

Pause in ms before warnings appear while typing.

number600
messages

Override any visible string, e.g. to translate.

Partial<typeof UPI_ID_MESSAGES>—

* required. Also accepts the native props of <input> (className, aria-*, data-*…), passed through to it.

How is UPI ID Input accessible?

  • Visible <label>; aria-invalid and status via aria-describedby
  • Status and suggestions in a polite live region
  • Handle suggestions are buttons with aria-labels

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Resolve the payee name server-side through your PSP before payment, and show it from that response, not from the link.

  • Format looks valid ≠ exists: only your verify callback can confirm the ID and its registered name
  • Handle list is common handles, not NPCI's full list
  • Name matching is approximate

What expensive mistakes does UPI ID Input stop?

UPI payment to the wrong VPA

Also known as

upi · upi id · vpa · gpay · phonepe · paytm · upi://pay · payout

Field type

What dependencies does UPI ID Input require?

UPI ID Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameUPI ID Input
Registry identifier@bollard/upi-id-input
Install commandnpx shadcn@latest add @bollard/upi-id-input
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-19
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about UPI ID Input

How does UPI ID Input validate Indian financial identifiers?

UPI ID Input stops uPI payment to the wrong VPA. Complies with national standards for Pasted upi://pay links, reduced to the pa address, Email addresses typed as UPI IDs, Typo'd handles, with one-tap corrections, App names typed as handles (@gpay → its real handles), Phone-number IDs with the wrong length or a +91 prefix, Registered name that differs from the expected or link-claimed name. Limitation: verify upi-id-input with issuer gateway.

How do I install upi-id-input with shadcn?

Run `npx shadcn@latest add @bollard/upi-id-input`. Sources added: registry/default/upi-id-input/upi-id-input.tsx, registry/default/upi-id-input/upi.ts. Package requirements: lucide-react.

What props customize UPI ID Input?

UPI ID Input accepts `label`, `value`, `defaultValue`, `onValueChange`, `verify`. Configures upi, upi id, vpa behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of upi-id-input?

Format looks valid ≠ exists: only your verify callback can confirm the ID and its registered name. Handle list is common handles, not NPCI's full list. Name matching is approximate Server requirement: Resolve the payee name server-side through your PSP before payment, and show it from that response, not from the link.

How does UPI ID Input meet accessibility guidelines?

Visible <label>; aria-invalid and status via aria-describedby. Status and suggestions in a polite live region. Handle suggestions are buttons with aria-labels. Minimizes errors: upi id validation, wrong upi handle.

Which components pair with UPI ID Input?