icons
GitHub提供 Fluent UI 图标选型、命名及打包规范。指导在 TSX 中通过 CLI 搜索已安装包或在线仓库获取图标,推荐动态缩放图标并演示 bundleIcon 用法。
Trigger Scenarios
Install
npx skills add github/replica --skill icons -g -y
SKILL.md
Frontmatter
{
"name": "icons",
"description": "Conventions for picking, sizing, and bundling Fluent icons. USE WHEN: adding or changing an icon in a `*.tsx` file, or picking an icon name."
}
Icon Usage
When looking for icon names,
- Prefer searching the installed
@fluentui/react-iconsexports so the names match the version the app actually uses. Run this from this app's directory, replacing the search expression with the concept you need:
node -e "const icons = require('@fluentui/react-icons'); console.log(Object.keys(icons).filter(name => /document.*add/i.test(name) && !/\d/.test(name) && /(?:Regular|Filled)$/.test(name)).join('\n'));"
The example searches document-add icons, excludes numbered-size exports, and keeps filled/regular styles.
- As an alternate, search the icon repo names for discovery or visual previews:
https://github.com/microsoft/fluentui-system-icons/blob/main/icons_regular.mdorhttps://github.com/microsoft/fluentui-system-icons/blob/main/icons_filled.md. - After choosing an icon through an alternate method, verify that its exact export name exists in the installed
@fluentui/react-iconspackage; the online catalog may include icons from newer versions.
Prefer using the unsized icons without the number suffix, e.g. TextBulletListTreeFilled instead of TextBulletListTree20Filled. This allows the icon to scale dynamically within buttons and other components.
When adding icons to Fluent components, use the bundleIcon utility from @fluentui/react-icons to combine filled and regular icons. For example:
const TraceIcon = bundleIcon(TextBulletListTreeFilled, TextBulletListTreeRegular);
<Button icon={<TraceIcon />} />;
Version History
- f19c050 Current 2026-11-07 08:51


