@amcdnl/react-flagpack

中文文档
1.2.1发布于 2022/07/15MITTypeScriptES Module零依赖近 30 天下载 1938

Gorgeous flag components for your React project.

原始使用文档
文档目录10 节
  1. react-flagpack
  2. Installation
  3. Usage
  4. Defining the component
  5. Use in JSX
  6. Available component configurations — Props
  7. Support
  8. Releases
  9. Contribute
  10. License

Flagpack

Flagpack contains 250+ flag icons to easily use within your code project. Flagpack is an open source project and available for JavaScript frameworks/libraries React, Vue and Svelte.

Flagpack. 260+ easily implementable flag icons to use in your design or code project. Open Source. Available for Sketch, Figma, Angular, Vue, and React. www.flagpack.xyz. Made with love by Yummygum. Graphic showing a list with the flags of Argentina, Croatia, Estonia, Kenia, Netherlands, and Scotland.

View documentation on flagpack.xyz

react-flagpack

Flagpack for React is created using React v16.8. The Flagpack component has not been tested for compatibility with older versions of React.

Installation

$: npm install react-flagpack --save

Usage

Defining the component

Import the Flagpack component into any of your project's React components.

import Flag from 'react-flagpack'

Use in JSX

<Flag
  code="NL"
  gradient="real-linear"
  size="m"
  hasDropShadow
/>

Available component configurations — Props

KeyValueRequiredDefaultFormat
codeStringfalse'NL'See all codes
sizeStringfalse'L''S', 'M' or 'L'
classNameStringfalse--
hasDropShadowBooleanfalsefalse-
hasBorderBooleanfalsetrue-
hasBorderRadiusBooleanfalsetrue-
gradientStringfalse'''top-down', 'real-linear' or 'real-circular'

Support

Frequently Asked Questions

Documentation

Releases

You can find a changelog of Flagpack's releases on the Releases page on GitHub.

Contribute

If you're interested in contributing to this project, great! Please see the contributing document how to set up you up.

License

Flagpack is an open source project published under a MIT license.

版本与发布记录

@amcdnl/react-flagpack 共发布 2 个版本,首次发布于 2022/07/15;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.2.1latest2022/07/154 年前
1.2.02022/07/154 年前

关于 @amcdnl/react-flagpack 的常见问题

@amcdnl/react-flagpack 是什么?

Gorgeous flag components for your React project.

如何安装 @amcdnl/react-flagpack?

在项目目录运行 npm install @amcdnl/react-flagpack,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^16.8.* || ^17.*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@amcdnl/react-flagpack 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@amcdnl/react-flagpack 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@amcdnl/react-flagpack 可以商用吗?

@amcdnl/react-flagpack 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@amcdnl/react-flagpack 的下载量有多少?

根据 npm 官方下载统计,@amcdnl/react-flagpack 在 2026/10/06 – 2026/11/04 这 30 天内被下载 1,938 次,日均约 65 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@amcdnl/react-flagpack 还在维护吗?

最新版本 1.2.1 发布于 2022/07/15(4 年前);至今共发布 2 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/07/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。