feat(badges): add country flag "built in {country}" provider#117
Merged
Conversation
Add a /flag/{code} provider that renders a "built in {country}" badge with
the country flag as a natural-aspect chip on the left. Supports all 265
country-flag-icons codes (ISO 3166-1 alpha-2 plus regions/subdivisions like
eu, gb-eng, es-ct), case-insensitive, with automatic definite-article
phrasing (us -> "the USA").
- core: getFlagBadge provider + flags.json code->name map (265 entries)
- core: FlagEl renders the flag SVG as a 3:2 <img> chip (preserves colors)
- core: route handler wires /flag/{code}, defaults to secondary variant
- web: docs page, sidebar nav, API reference, README, badge builder preset
- web: showcase Location category + 30-flag /dev/social seed for socials
Also drops a stale, now-unused eslint-disable directive in
badge-builder-core.tsx that blocked lint-staged.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new
/flag/{code}badge provider that renders a "built in {country}" badge with the country flag as a natural-aspect chip on the left.country-flag-iconscodes (ISO 3166-1 alpha-2 plus regions/subdivisions likeeu,gb-eng,es-ct)/flag/us,/flag/US)us→ "the USA",gb→ "the UK",nl→ "the Netherlands")cn→ "China", not "People's Republic of China")Why
A frequently-requested "made in / built in {country}" badge for READMEs, product pages, and OSS profiles. Flags render as a crisp chip at their natural 3:2 proportions — no stretching, no cropping — so every flag (stripes, circles, emblems) reads correctly.
Closes #
Type
feat— New featureHow
getFlagBadge()provider +flags.json(265 code→name map);FlagElrenders the flag SVG as a Satori<img>chip (preserves original multi-color fills, unlike the monochrome icon path); route handler wires/flag/{code}, defaults to thesecondaryvariant./docs/badges/flag), sidebar nav, API reference, README badge table, badge-builder preset (new "Other" group), showcase Location category, and a 30-flag/dev/socialseed for social screenshots.eslint-disabledirective inbadge-builder-core.tsxthat was failinglint-staged --max-warnings 0(pre-existing onmain).Checklist
feat/flag-provider)pnpm devScreenshots
Renders verified locally (SVG + PNG) for US, UK, Japan, Germany, France, Canada, Brazil, India, South Korea, Australia, Mexico, South Africa, EU — all at correct proportions in both dark and light mode.
/flag/us.svg→ 🇺🇸 built in the USA