Docs
219 logos of 39 Vietnamese banks and 180 merchant brands, plus 36 Vietnamese dishes, four ways to use them. Pick whichever fits.
Getting started
The quickest way: add a logo to your React project as a component.
npx vnlogos add vcb highlandsThat writes components/logos/vcb.tsx and components/logos/highlands.tsx. Each file holds the logo as a data URI, so there is nothing else to copy or configure.
import { VcbLogo } from "@/components/logos/vcb";
import { HighlandsLogo } from "@/components/logos/highlands";
<VcbLogo height={24} />
<HighlandsLogo size={40} />Not on React? Install the npm package for the files and data, or link a file from the CDN. Every logo also has its own page; find one with ⌘ K.
The npx CLI
No install needed. Every command works with npx, pnpm dlx, yarn dlx and bunx.
| Command | What it does |
|---|---|
vnlogos add <id...> | Writes one React component per logo or line icon into your project. --lines picks the icon when an id is also a dish. |
vnlogos list [query] | Lists ids and names; the query also matches provinces. --banks, --brands, --dishes or --lines narrows it. |
vnlogos info <id> | Colours, MCCs, statement spellings, provinces and file paths. |
vnlogos copy <dir> | Copies every PNG and SVG into a folder, such as public/logos. |
Options for add
| Option | Default |
|---|---|
--dir <path> | src/components/logos when there is a src folder, else components/logos |
--js | Writes .jsx. Without a tsconfig.json this is already the default. |
--overwrite | Replaces a file that already exists; otherwise it is kept. |
npx vnlogos list coffee
npx vnlogos info phuc-long
npx vnlogos list --lines "ha noi"
npx vnlogos copy public/logos --banksphuc-long, bach-hoa-xanh. Banks use their short code: vcb, tcb, mbb.Components
Brand components draw a square tile; bank components draw the wordmark at a fixed height.
| Prop | Applies to | Default | Meaning |
|---|---|---|---|
size | Brands | 40 | Tile side in px. |
radius | Brands | 24% of size | Corner radius in px. |
height | Banks | 24 | Height in px; width follows the logo. |
variant | Banks | "color" | "mono" draws the logo in one colour through a CSS mask. |
tint | Banks | currentColor | The colour for variant="mono". |
Every other prop goes to the <img>: className, alt, loading and so on. Bank logos in colour are made for light backgrounds. On a dark one, use variant="mono" with a light tint, or put the logo on a white plate.
Install the package
npm install vnlogospnpm add vnlogosyarn add vnlogosbun add vnlogosNode 18 or later. No dependencies; React is only needed for vnlogos/react. ESM, CommonJS and TypeScript types are included.
Data
import { brands, banks, getBrand, getBank } from "vnlogos";
getBrand("gs25");
// { id: "gs25", name: "GS25", mark: "GS25",
// background: "#0A8FD1", foreground: "#FFFFFF",
// aliases: ["gs 25"], category: "Convenience", mccs: ["5499"],
// logo: { file: "brands/gs25.png", format: "png", width: 512, height: 512 } }
getBank("vcb").logos.color.file; // "banks/vcb.png"| Field | Meaning |
|---|---|
mark | One to four characters to draw when there is no image. |
backgroundforeground | Tile and mark colours, #RRGGBB. The background matches the edge of the logo. |
aliases | Other ways the name is printed on receipts and statements. |
categorymccs | The kind of merchant and the merchant category codes it usually charges under. |
coloraccent | A bank's two logo colours. |
logos.color | The bank's logo file as published. |
logos.monooneColour | To draw a bank logo in one colour, use logos.mono ?? logos.color as a mask. mono exists only where the colour file has a detail a fill would cover. oneColour is false when the file sits on a solid box. |
cardsUrl | The bank's credit card page. |
Statement matching
matchBrand() finds the brand in the merchant name a bank prints. Accents and case don't matter.
import { matchBrand } from "vnlogos";
matchBrand("POS GS25 HCM")?.id; // "gs25"
matchBrand("MINISTOP Q.3")?.id; // "ministop"
matchBrand("Bách hoá xanh Q7")?.name; // "Bách Hoá Xanh"
matchBrand("Corner shop"); // undefined- A name or alias must appear as whole words, so “Bé Mart” does not match Be.
- When several brands match, the earliest one in the text wins, then the longest.
- One- and two-letter aliases only match the whole text.
- A brand's
notWithwords rule it out:"AMAZON PRIME"is not Prime.
Files and data URIs
Every logo is a file in the package. Vite, Next.js and webpack turn an import into a URL.
import gs25 from "vnlogos/brands/gs25.png";
import vcb from "vnlogos/banks/vcb.png";
import hsbcMask from "vnlogos/banks/hsbc-mono.svg";For email, canvas or PDF work, import a data: URI instead. Each logo is its own module, so a bundler keeps only what you import.
import { brandGs25, bankVcb, bankHsbcMono } from "vnlogos/inline";
import tcb from "vnlogos/inline/banks/tcb";import * from vnlogos/inline: that pulls in all 298 logo files, about 5.5 MB.React helpers
If you'd rather not copy components, the package has two that load files from a folder. Copy the files once, then point the provider at it.
npx vnlogos copy public/logosimport { BrandTile, BankLogo, LogoProvider } from "vnlogos/react";
<LogoProvider baseUrl="/logos">
<BrandTile brand="highlands" size={44} />
<BankLogo bank="vcb" height={24} />
<BankLogo bank="hsbc" variant="mono" />
</LogoProvider>BrandTile falls back to the brand's mark on its colour when the image is missing; BankLogo falls back to the bank's name. Both take src to use an imported URL or data URI.
Dishes
36 dishes from the three regions, drawn for vnlogos. Each has an icon (dishes/<id>.svg, the dish on a clear ground) and a seal (dishes/<id>-seal.svg, a round stamp with its name and hometown). Both are SVG, 200 × 200.
npx vnlogos add pho-bo bun-bo-hue com-tamimport { getDish, logoUrl } from "vnlogos";
import { DishLogo } from "vnlogos/react";
getDish("bun-bo-hue").english; // "Spicy lemongrass beef noodle soup"
logoUrl(getDish("com-tam"), "/logos", "seal"); // "/logos/dishes/com-tam-seal.svg"
<DishLogo dish="pho-bo" size={48} tile />
<DishLogo dish="bun-bo-hue" variant="seal" size={96} />| Field | Meaning |
|---|---|
nameenglish | Vietnamese name with accents, and a short English gloss. |
regionplace | bac, trung or nam, and the town the dish is famous from. |
description | One sentence in Vietnamese on what goes into it. |
backgroundcolor | The region's tile colour and seal colour. |
logos.iconlogos.seal | The two SVG files. |
The drawings are original artwork made for vnlogos and are MIT licensed with the code.
shadcn registry
Every logo is also a registry item, so the shadcn CLI can add the same component:
npx shadcn@latest add https://vnlogos.com/r/vcb.jsonSwap vcb for any id. The file is the one npx vnlogos add writes.
CDN and JSON
No build step? Link a file from jsDelivr, pinned to a version:
<img src="https://cdn.jsdelivr.net/npm/vnlogos@0.1.1/logos/brands/gs25.png" width="44" alt="GS25">
<img src="https://cdn.jsdelivr.net/npm/vnlogos@0.1.1/logos/banks/vcb.png" height="24" alt="Vietcombank">All the data as one JSON file: https://cdn.jsdelivr.net/npm/vnlogos@0.1.1/dist/meta.json.
Contributing
Missing a bank or brand? Suggest it, or send a pull request:
- Brands:
logos/brands/<id>.png, square, at least 512 px. - Banks:
logos/banks/<id>.svg(preferred) or a PNG at most 240 px high; a mask for one-colour drawing is<id>-mono. - Add the entry to
data/brands.jsonordata/banks.jsonand runnpm test. - Official sources only: the brand's site or press kit, its App Store or Google Play icon, or Wikimedia Commons.
Details in the contributing guide.
Trademarks
Every bank and brand logo is a trademark of its owner. vnlogos is not affiliated with or endorsed by any bank or brand in it, and the MIT license covers only the code, the data and the dish drawings. Use a logo to identify the bank or merchant, for example next to a card or a transaction, not to suggest a partnership.
Own a brand and want its logo changed or removed? Open a removal request. More in the legal notice and the MIT license.