vn/ui / Docs / Components

VietQR

Generate a bank transfer QR code on your device.

Preview

₫
VietQR
Generating…

The Code tab uses the common @/* alias. Import the copied file from the directory in vnui.json if your app uses a different path.

Installation

Initialize vn/ui in your app, then add this component.

npx @naminc/vnui@latest add vietqr

Usage and variants

Generate NAPAS247 account-transfer instructions with a CRC-16 checksum. Keep leading zeros in account numbers. Download the locally rendered code as SVG or PNG. Payment confirmation must come from the bank.

<VietQR bankBin="970436" accountNumber="0000000123" description="DEMO" size={256} />

API

PropTypeBehavior
bankBinstringSix-digit bank BIN.
accountNumberstring1–19 ASCII letters or digits.
amountstring | number | bigintOptional positive whole VND, up to 13 digits.
descriptionstringOptional transfer message, up to 25 supported ASCII characters.
sizenumberDisplay width in pixels.

Set className to style the figure. Input errors are announced inline.

Accessibility

The generated image has an accessible description. Download links are keyboard reachable.

Invalid transfer details appear as an alert. While the local QR image is rendering, a status message is announced; download links appear only when ready.