一键导入
nuxt-icon-skilld
ALWAYS use when writing code importing "@nuxt/icon". Consult for debugging, best practices, or modifying @nuxt/icon, nuxt/icon, nuxt icon, icon.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
ALWAYS use when writing code importing "@nuxt/icon". Consult for debugging, best practices, or modifying @nuxt/icon, nuxt/icon, nuxt icon, icon.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use Claude, Anthropic's AI assistant, right from your terminal. Claude can understand your codebase, edit files, run terminal commands, and handle entire workflows for you. ALWAYS use when writing code importing "@anthropic-ai/claude-code". Consult for debugging, best practices, or modifying @anthropic-ai/claude-code, anthropic-ai/claude-code, anthropic-ai claude-code, anthropic ai claude code, claude-code-2.1.88, claude code 2.1.88.
daisyUI 5 - The Tailwind CSS Component Library. ALWAYS use when writing code importing "daisyui". Consult for debugging, best practices, or modifying daisyui.
An AST-based pattern checker for JavaScript. ALWAYS use when writing code importing "eslint". Consult for debugging, best practices, or modifying eslint.
ALWAYS use when writing code importing "node-gyp". Consult for debugging, best practices, or modifying node-gyp, node gyp.
A CLI tool to run multiple npm-scripts in parallel or sequential. (Maintenance fork). ALWAYS use when writing code importing "npm-run-all2". Consult for debugging, best practices, or modifying npm-run-all2, npm run all2.
Generate ESLint config from current Nuxt settings. ALWAYS use when writing code importing "@nuxt/eslint". Consult for debugging, best practices, or modifying @nuxt/eslint, nuxt/eslint, nuxt eslint, eslint.
| name | nuxt-icon-skilld |
| description | ALWAYS use when writing code importing "@nuxt/icon". Consult for debugging, best practices, or modifying @nuxt/icon, nuxt/icon, nuxt icon, icon. |
| metadata | {"version":"2.2.4","generated_by":"Anthropic · Haiku 4.5","generated_at":"2026-06-29T00:00:00.000Z"} |
@nuxt/icon@2.2.4Tags: latest: 2.2.4
References: package.json • README • Docs • Issues • Releases
Use skilld search "query" -p @nuxt/icon instead of grepping .skilld/ directories. Run skilld search --guide -p @nuxt/icon for full syntax, filters, and operators.
This section documents version-specific API changes for @nuxt/icon — prioritize recent major/minor releases.
NEW: icon.cssLayer — v2.2.x added support for TailwindCSS v4, configurable CSS layer injection point via app.config.ts source
NEW: icon.serverBundle.remote — v2.1 (branded as v1.2 in earlier docs) added remote CDN option with jsdelivr, unpkg, or github-raw providers to avoid bundling collections source
NEW: icon.serverBundle.externalizeIconsJson — v2.2.x added option to externalize icon JSON files instead of bundling them, requires Node.js v22+ for JSON module imports source
NEW: customCollections[].recursive — v2.1.0 added nested folder scanning for custom collections, enabling recursive SVG discovery source
NEW: icon.provider: 'none' — v1.13.0 added provider mode to completely disable runtime fetching and use only client bundle source
NEW: :customize="false" prop — v1.12.0 allows disabling per-component customization override while preserving global settings source
NEW: customCollections[].normalizeIconName: false — v1.10.0 enables case-sensitive custom icon names, bypassing kebab-case normalization; defaults to true for backward compatibility but will default to false in a future major version source
NEW: IconifyJSON as custom collection — v1.12.0 added support for passing raw IconifyJSON objects directly in customCollections instead of only file paths source
Also changed: Icon component in render functions via #components import (documented usage pattern) · Server bundle mode auto auto-selects between local/remote based on deployment environment (Cloudflare Workers defaults to remote) · Client bundle scan option with fine-grained glob control for component scanning · Custom collection imports now handle Nuxt 4 app/assets directory structure · Server endpoint /api/_nuxt_icon/:collection customizable via icon.localApiEndpoint
@nuxt/icon is a Nuxt module for displaying icons from Iconify and custom collections with flexible rendering modes (CSS or SVG), intelligent bundling strategies, and performance optimizations.
Use fill="currentColor" in custom SVG icons to generate mask-image CSS rules for dynamic color support — this enables Tailwind color classes like text-white and fill-white to work correctly, as Iconify icons use mask-based rendering by default source source
Set mode: 'svg' for custom icons requiring dynamic styling — SVG mode inlines the SVG content directly (bypassing CSS mask rendering) and allows currentColor attributes to inherit colors from parent elements source source
Configure serverBundle: 'remote' to reduce build size when only using Iconify collections — remote mode fetches icons from Iconify API on demand without bundling the full collection data source
Install @iconify-json/* packages explicitly for icons listed in clientBundle.icons — the module does not fetch icons from the network; it reads from installed packages during build source
Enable clientBundle.scan: true to auto-detect used icons from your codebase — scanning finds all icon references without manual configuration, though it requires icon collection packages to be installed source
Set serverBundle: false and provider: 'iconify' for SPA deployments with client-side only icon fetching — this avoids server bundling while fetching icons directly from Iconify API in the browser source
Wrap icons in <ClientOnly> when using SSR to prevent hydration mismatches — icons may not render identically on server and client, causing hydration warnings; ClientOnly ensures rendering happens only on the client source
Use CSS mode (default) for production performance — CSS mode generates smaller bundles and is more efficient than SVG mode for most use cases source
Set customCollections with dir option instead of inline icons for maintainability — directory-based collections allow organizing icons as SVG files with automatic scanning support source
Configure customize callback for global icon transformations — use this option to apply consistent modifications (colour, stroke-width, viewBox adjustments) to all icons without modifying source files
icon: {
customize: (svg) => {
svg.replace('stroke="2"', 'stroke="1.5"');
return svg;
};
}
Enable cssWherePseudo: true (default) to reduce CSS specificity conflicts — the :where() pseudo-selector ensures icon styles don't override component styling unexpectedly source
Use icon aliases for easier refactoring and consistent naming — aliases decouple icon names from implementation, simplifying updates across the codebase
icon: {
aliases: {
'arrow': 'mdi:chevron-right',
'close': 'mdi:close'
}
}
Set fetchTimeout to 3000–5000ms for reliable fetching in slow networks — default 1500ms may timeout on mobile or high-latency connections source
Nest custom icons within subdirectories using customCollections with dir — v2.1.0+ automatically scans nested folders, eliminating the need for multiple collection entries source
Set provider: 'none' with client bundle for offline applications — this disables all network fetching and relies entirely on pre-bundled icons source