npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sankyu/solid-circle-flags

v0.1.5

Published

400+ circular SVG Solid.js flags — tree-shakeable, TypeScript-ready, SSR-compatible, zero deps.

Downloads

557

Readme

@sankyu/solid-circle-flags

npm version Bundle Size npm downloads Last Commit

CI Release codecov

TypeScript supported Tree-shakable MIT License


English Version

:star: Star us on GitHub | :bug: Report Issues here

:rocket: Explore the Demo Gallery | :book: Read the Documentation


[!NOTE] 🚧 Beta Release

This package is currently in beta. APIs may change in future releases. Please report any issues you encounter!

📖 Overview

This library provides 400+ circular SVG flag components for Solid.js with Full-TypeScript support & Tree-shaking Optimization.

Perfect for applications that need fast, crisp country flags without external image requests.

:world_map: Live Demo

Open in StackBlitz

✨ Key Features

  • 🎯 Tree-shakable - Only bundle the flags you use
  • 📦 TypeScript - Full type definitions included
  • Zero dependencies - Only requires Solid.js as peer dependency
  • 🎨 Inline SVG - No external requests, works offline
  • 🔧 Fully customizable - All standard SVG props supported
  • 📱 SSR compatible - Works with SolidStart, etc.
  • 🪶 Lightweight - Each flag is ~1KB

📦 Installation

npm install @sankyu/solid-circle-flags
# or
pnpm add @sankyu/solid-circle-flags
# or
yarn add @sankyu/solid-circle-flags
# or
bun add @sankyu/solid-circle-flags

🤖 Are you Vibe Coding?

Copy this into your AI Agent (Claude Code, Codex, Cursor ..like) to optimize your flags:

Act as an expert Web Engineer. Reference: https://react-circle-flags.js.org/llms.txt & https://react-circle-flags.js.org/llms-small.txt

1. **Audit my project** to find any flag usage:
   - Raw `<img>` tags pointing to `HatScripts/circle-flags` URLs.
   - Legacy `react-circle-flags` library usage.
2. **Propose a migration** to the appropriate `@sankyu/{framework}-circle-flags` package based on my current framework (React/Vue/Solid).
3. **Optimize for Tree-shaking**: Replace generic `CircleFlag` components or raw tags with **named imports** (e.g., `import { Us } from '...'`) as per the docs.

🚀 Usage

Import individual flags (Recommended)

import { FlagUs, FlagCn, FlagGb } from '@sankyu/solid-circle-flags'

export default function App() {
  return (
    <div>
      <FlagUs width={48} height={48} />
      <FlagCn width={48} height={48} />
      <FlagGb width={48} height={48} />
    </div>
  )
}

Using FlagSizes presets

import { FlagJp, FlagDe, FlagFr, FlagSizes } from '@sankyu/solid-circle-flags'

export default function App() {
  return (
    <div>
      <FlagJp width={FlagSizes.sm} height={FlagSizes.sm} />
      {/* 24px */}
      <FlagDe width={FlagSizes.md} height={FlagSizes.md} />
      {/* 32px */}
      <FlagFr width={FlagSizes.lg} height={FlagSizes.lg} />
      {/* 48px */}
    </div>
  )
}

Dynamic flag selection

import { createSignal } from 'solid-js'
import { DynamicFlag } from '@sankyu/solid-circle-flags'

export default function App() {
  const [countryCode, setCountryCode] = createSignal('us')

  return (
    <div>
      <DynamicFlag code={countryCode()} width={48} height={48} />
      <button onClick={() => setCountryCode('cn')}>Change to China</button>
    </div>
  )
}

[!CAUTION] DynamicFlag is offline-first and renders runtime codes synchronously, but it bundles all 400+ flags (~600 KB, no tree-shaking). Prefer named imports when possible. If runtime codes are bounded, use a finite named-import map.

📚 API

Props

| Prop | Type | Default | Description | | ----------- | ------------------ | ------- | ---------------------------- | | width | number \| string | 48 | Width of the flag | | height | number \| string | 48 | Height of the flag | | title | string | code | Accessible title for the SVG | | class | string | - | Standard Solid class binding | | className | string | - | Optional className alias |

Size Presets

| Size | Pixels | | ------ | ------ | | xs | 16px | | sm | 24px | | md | 32px | | lg | 48px | | xl | 64px | | xxl | 96px | | xxxl | 128px |

Build Meta Information

You can access the library's build meta information from the buildMeta export:

import { buildMeta } from '@sankyu/solid-circle-flags'

console.log(buildMeta.version) // e.g., "0.0.1"
console.log(buildMeta.builtTimestamp) // e.g., 1760000000000
console.log(buildMeta.commitHash) // e.g., <example-sha256-hash>
console.log(buildMeta.circleFlagsCommitHash) // e.g., <example-sha256-hash>

Available Flags

Each flag is exported with the pattern Flag{PascalCase ISO_CODE} (for example, FlagUs, FlagCn). Convenience aliases are provided for common two-letter codes: FlagUs, FlagCn, FlagGb, FlagJp.

  • FlagUs - United States
  • FlagCn - China
  • FlagGb - United Kingdom
  • FlagJp - Japan
  • ... and many more

See the Full list of flags in the gallery.

🎨 Styling

Flag components accept all standard SVG attributes and can be styled using Solid's class binding.

import { FlagUs } from '@sankyu/solid-circle-flags'

export default function App() {
  return (
    <>
      {/* Using class */}
      <FlagUs class="rounded-full shadow-lg hover:scale-110 transition-transform" />

      {/* Using inline styles */}
      <FlagUs style={{ filter: 'grayscale(100%)' }} />

      {/* With custom attributes */}
      <FlagUs aria-label="United States flag" role="img" />
    </>
  )
}

🔧 TypeScript

All flag components are fully typed with TypeScript, providing autocomplete and type safety out of the box.

import type { FlagComponentProps, FlagCode } from '@sankyu/solid-circle-flags'

// FlagCode is a union type of all valid flag codes
const code: FlagCode = 'us' // ✓ Valid
const invalid: FlagCode = 'xyz' // ✗ Type error

📦 Bundle Size & Tree-shaking

@sankyu/solid-circle-flags is designed to be tree-shakable.

Importing individual flags ensures that only the used flags are included in your bundle.

// ✓ Good - only FlagUs and FlagCn are bundled
import { FlagUs, FlagCn } from '@sankyu/solid-circle-flags'

🤝 Contributing

Please see CONTRIBUTING.md for contribution guidelines.

📄 License

@sankyu/solid-circle-flags is licensed under the MIT License, © Sankyu Lab

🙏 Credits