@flipdish/ui-icons

中文文档
0.7.0发布于 2026/10/21TypeScriptESM + CJS近 30 天下载 2798

Flipdish Design System icons — a stable, source-agnostic import surface wrapping @untitledui/icons.

原始使用文档
文档目录5 节
  1. Installation
  2. Usage
  3. Why a separate package
  4. Changelog
  5. Contributing

@flipdish/ui-icons

A single, source-agnostic import surface for icons used across the Flipdish Design System. Wraps @untitledui/icons behind a stable seam, plus any Flipdish-specific custom icons.

import { SearchLg } from "@flipdish/ui-icons";

Internal design system, published publicly. Built for Flipdish products and shared across Flipdish micro-frontends; on the public npm registry for that reason rather than as a general-purpose icon library.

Part of the Flipdish Design System:

PackagePurpose
@flipdish/ui-tokensDesign tokens — colours, type scale, spacing
@flipdish/ui-iconsIcon set (this package)
@flipdish/ui-libraryComponents
@flipdish/ui-connectedAPI-connected components

Installation

pnpm add @flipdish/ui-icons

react is the only peer dependency (icons are React components; you provide React).

Usage

Prefer the per-icon subpath — identical on web and React Native, and the only form that tree-shakes on Metro (the root barrel pulls every listed icon into the native bundle):

import { SearchLg } from "@flipdish/ui-icons/SearchLg";
import { PlaceholderIcon } from "@flipdish/ui-icons/PlaceholderIcon";

<SearchLg className="size-5 text-secondary" />;

The root import still works for web (and for the curated native subset listed in src/index.native.ts):

import { SearchLg, FileIcon, PlaceholderIcon } from "@flipdish/ui-icons";

On web, icons take standard SVGProps<SVGSVGElement>, use currentColor, and are sized via props/utilities — so they recolour through semantic token utilities (text-*) and dark mode for free. Named ESM exports stay tree-shakeable in production builds (this package and @untitledui/icons both declare sideEffects: false).

On React Native, the react-native export condition selects a react-native-svg build generated from upstream at build time (scripts/generate-icons.mjs), so every upstream icon is available via its subpath. Native icons take size / color / strokeWidth rather than web's width / height / SVGProps. The default color is a light-mode stand-in for fg-quaternary (#a3a3a3); pass color explicitly when a parent component knows the token. Six directional icons carry a web-only data-rtl-flip attribute that is dropped on native — RTL mirroring is the consuming screen's responsibility.

Why a separate package

  • Lean component library — icon sets are large and version independently; bundling them into @flipdish/ui-library would bloat every consumer regardless of which icons it uses.
  • Stable seam — consumers import from @flipdish/ui-icons; the backing source can change without breaking import sites.
  • Cross-platform ready — isolating icons keeps the eventual web (SVG) + React Native (react-native-svg) split out of the component layer.

Changelog

See CHANGELOG.md for release history.

Contributing

This package lives in the flipdish-design-system monorepo. Contributor documentation — including how to add or override an icon — lives alongside the source there.

版本与发布记录

@flipdish/ui-icons 共发布 9 个版本,首次发布于 2026/06/22;过去 12 个月发布了 9 个版本。

版本发布日期距今
0.7.0latest2026/10/2125 天前
0.6.02026/10/2027 天前
0.5.02026/10/141 个月前
0.4.02026/08/113 个月前
0.3.32026/08/063 个月前
0.3.22026/07/223 个月前

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

@flipdish/ui-icons 是什么?

Flipdish Design System icons — a stable, source-agnostic import surface wrapping @untitledui/icons.

如何安装 @flipdish/ui-icons?

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

@flipdish/ui-icons 支持 TypeScript 吗?

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

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

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

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

@flipdish/ui-icons 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

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

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

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

最新版本 0.7.0 发布于 2026/10/21(25 天前);至今共发布 9 个版本,其中过去 12 个月发布了 9 个;首次发布于 2026/06/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。