Sep 1, 2025
0 views
A flexible component for rendering country flags (via ISO 3166-1 alpha-2 codes) with optional names or codes. Supports both dropdown selection and direct text input for seamless integration with static designs and CMS data pipelines.
//
Tags
Add to your Framer project and place on the canvas.
Choose Select → List (dropdown) or Select → Write (string input).
Configure Country (if List) or Search (if Write).
Adjust typography, alignment, spacing, and radius.
Use label toggles to display name, code, or hide entirely.
Preset A: List → TR, Name → “Turkey”, Right position, Flag 24×18, Radius 4px
Preset B: Write → "JP", Display → Code, Alignment → Center
Preset C: List → US, Name hidden, Flag 40×30, Alignment → Right
Internal countryList holds { code, name } pairs (ISO 3166-1).
List Mode: Direct lookup by enum prop.
Write Mode: Lowercased input string matched against name/code.
Flag image loaded from https://flagcdn.com/w40/{code}.png.
Flexbox handles alignment, spacing, and label placement.
Images are small (~2–4 KB each).
Prefer “List” mode for controlled designs.
“Write” mode sensitive to exact matches (avoid typos).
Works in all modern browsers.
Dependent on CDN availability for flags.
No offline fallback; requires network.
Flags are <img> with alt text = "Country flag".
Labels inherit provided font and color for legibility.
Supports baseline offset for vertical optical alignment.
No network calls except image fetch from trusted CDN.
No data storage, eval, or innerHTML usage.
No device permissions required.
Flags are <img> with alt text = "Country flag".
Labels inherit provided font and color for legibility.
Supports baseline offset for vertical optical alignment.
No network calls except image fetch from trusted CDN.
No data storage, eval, or innerHTML usage.
No device permissions required.
Country data: ISO 3166-1 alpha-2.
Implementation & Framer adaptation by SecretoCho Design.
SecretoCho Design
Source Link
SecretoCho Design 2025
Provided “as is” for visual/UX purposes. Validate performance, accessibility, and licensing for your project.
Stay ahead of the curve with insights into emerging visualization trends and technologies.