circle-flags-mithril
v1.0.0
Published
Circle flag SVGs as Mithril.js components
Maintainers
Readme
circle-flags-mithril
Circle Flags SVGs as Mithril.js components. Based on the same build approach as lucide-mithril.
Install
bun add circle-flags-mithril
# or
npm install circle-flags-mithrilUsage
Each component corresponds to a country/region code, prefixed with Flag and converted to PascalCase.
import m from 'mithril'
import { FlagUs, FlagCl, FlagGbEng } from 'circle-flags-mithril'
// Basic usage — renders at the default 512×512 size
m(FlagUs)
// Custom size (icons are circular/square)
m(FlagCl, { size: 64 })
// Any additional SVG attributes are passed through
m(FlagGbEng, { size: 48, class: 'my-flag' })Component naming
| Code | Component name |
|-------------------|----------------------|
| us | FlagUs |
| cl | FlagCl |
| gb-eng | FlagGbEng |
| aq-true_south | FlagAqTrueSouth |
| au-aboriginal | FlagAuAboriginal |
All 430 flags from circle-flags are available.
Build
To regenerate the components from the latest version of circle-flags:
bun run buildThe build script reads SVGs directly from the circle-flags npm package
(node_modules/circle-flags/flags/), so no manual cloning is needed.
Project structure
circle-flags-mithril/
├── build/
│ └── build.js # Build script
├── flags/ # Generated flag components (430 files)
│ ├── FlagUs.js
│ ├── FlagCl.js
│ └── ...
├── test/
│ ├── index.html # Usage example
│ └── main.js
├── default_attrs.js # Default SVG attributes (size, viewBox)
├── default_attrs.d.ts # TypeScript types for default_attrs
├── index.js # Generated entry point (all exports)
└── index.d.ts # Generated TypeScript declarationsLicense
MIT — flag SVG data is sourced from circle-flags (MIT).
