@frosted-ui/icons

中文文档
0.0.1-canary.164发布于 2026/11/13MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 3.3万

Frosted UI React Icons

原始使用文档
文档目录8 节
  1. Figma file
  2. Documentation
  3. Pictograms
  4. Configuring
  5. Bundle size
  6. next.js
  7. Contributing
  8. Acknowledgments

Frosted UI Icons

Icons used and designed by the Whop team

Figma file

Screenshot 2024-08-07 at 12 35 01

Documentation

All icons are available as individual React components. Each icon comes in 16, 20, 24 and 32 px size.

Install Frosted UI Icons from npm:

npm install @frosted-ui/icons

Import the icons into your React project:

import { Shop16, Shop20 } from '@frosted-ui/icons';

function MyComponent() {
  return (
    <div>
      <Shop16 />
      <Shop20 />
    </div>
  );
}

Pictograms

In addition to monochromatic UI icons, this package ships colorful pictograms sourced from the same Figma file (Pictograms page). Each pictogram is published as a single React component that takes a variant prop selecting one of four background-color tunings: 'auto' (the default), 'light', 'dark', or 'orange'.

import { ConePictogram, GradCapPictogram } from '@frosted-ui/icons';

function MyComponent() {
  return (
    <div>
      <ConePictogram /> {/* defaults to variant="auto" */}
      <ConePictogram variant="light" />
      <ConePictogram variant="dark" />
      <ConePictogram variant="orange" />
      <GradCapPictogram variant="auto" />
    </div>
  );
}

Pictograms preserve their original colors (no currentColor rewriting), so they don't accept a color prop. Other than variant, they accept all standard SVG props.

The auto variant

variant="auto" (the default) emits CSS light-dark() color values for every fill/stroke that differs between the light and dark variants. The browser then picks the right color based on the page's color-scheme — no React state, no media query listener, no hydration mismatch.

In a frosted-ui app this works without any wiring: the Theme component already sets color-scheme: light | dark on the root. In any other app you need a color-scheme declaration on a parent (e.g. :root { color-scheme: light dark; }) for the browser to know which arm to pick.

Browser support for light-dark() is Baseline since 2024 (Chrome 123, Safari 17.5, Firefox 120). In older browsers the auto variant falls back to no fill — pin the variant explicitly (variant="light") if you need to support pre-2024 browsers.

How the variants are packed

Internally the generator collapses the three background variants into one component by sharing geometry and switching only the per-element fill/stroke colors based on variant. For the rare pictogram whose Figma variants don't share identical geometry, the component falls back to inlining each variant's SVG body — same <NamePictogram variant="…" /> API either way. For those fallback pictograms, variant="auto" renders the light body in both light and dark color schemes.

Configuring

Bundle size

Named imports from the barrel tree-shake, so import { Shop16 } from '@frosted-ui/icons' costs one icon rather than the whole set. Every bundler that reads the import/module entry — webpack, Vite, Rollup, esbuild, Next.js — gets this by default, with no configuration.

CommonJS cannot tree-shake, so the CJS barrel instead defines each export as a getter that loads that icon's module on first access. require('@frosted-ui/icons') stays cheap in Node, which matters for Jest, SSR and scripts.

A bundler pinned to the CJS entry (mainFields: ['main']) is the one case that still pays for the whole set, because a bundler resolves every require() statically no matter when it runs. Deep-import there:

import Shop16 from '@frosted-ui/icons/Shop16';
import ConePictogram from '@frosted-ui/icons/pictograms/ConePictogram';

next.js

// next.config.mjs
/** @type {import('next').NextConfig} */
const nextConfig = {
  modularizeImports: {
    '@frosted-ui/icons': {
      transform: {
        // Pictograms live under `pictograms/` in the built package.
        '*Pictogram': '@frosted-ui/icons/pictograms/{{member}}',
        '*': '@frosted-ui/icons/{{member}}',
      },
      skipDefaultConversion: true,
    },
  },
};

export default nextConfig;

Contributing

Please follow our contributing guidelines.

Acknowledgments

Frosted UI Icons library setup is based on Radix Icons.

版本与发布记录

@frosted-ui/icons 共发布 63 个版本,首次发布于 2024/02/23;过去 12 个月发布了 43 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.0.1-canary.164latest2026/11/133 天前
0.0.1-canary.1632026/11/105 天前
0.0.1-canary.1622026/10/2720 天前
0.0.1-canary.1612026/09/221 个月前
0.0.1-canary.1602026/09/191 个月前
0.0.1-canary.1592026/09/092 个月前

关于 @frosted-ui/icons 的常见问题

@frosted-ui/icons 是什么?

Frosted UI React Icons

如何安装 @frosted-ui/icons?

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

@frosted-ui/icons 支持 TypeScript 吗?

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

@frosted-ui/icons 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@frosted-ui/icons 可以商用吗?

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

@frosted-ui/icons 的下载量有多少?

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

@frosted-ui/icons 还在维护吗?

最新版本 0.0.1-canary.164 发布于 2026/11/13(3 天前);至今共发布 63 个版本,其中过去 12 个月发布了 43 个;首次发布于 2024/02/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。