Overview
Nuxt UI includes built-in support for icons through the @nuxt/icon module, which is automatically installed and configured when you use Nuxt UI.Icon Module
The@nuxt/icon module is automatically registered by Nuxt UI with optimized settings:
Using Icons
Icon Component
Use theUIcon component to display icons throughout your application:
Icon Collections
Nuxt Icon supports multiple icon collections. You can use icons from:- Heroicons -
i-heroicons-{name} - Material Design Icons -
i-mdi-{name} - Phosphor -
i-ph-{name} - Tabler -
i-tabler-{name} - And 100,000+ other icons
Icons in Components
Many Nuxt UI components accept icon props to enhance their appearance:Buttons
Input Fields
Alerts
AppConfig Icons
Nuxt UI uses icons defined in yourapp.config.ts for various UI elements. You can customize these default icons:
app.config.ts
dark/light- Color mode toggle buttonssearch- Search inputs and command palettesclose- Modal, drawer, and alert close buttonscheck- Checkbox and selection indicators
Custom SVG Icons
You can also use custom SVG icons by adding them to yourpublic/icons directory:
Icon Sizing
Control icon size using Tailwind CSS classes:Icon Colors
Icons inherit the text color from their parent element:Icons in Nuxt UI use semantic color tokens like
text-primary, text-error, etc. See the Theme documentation for more information.Server-Side Rendering
Icons are fully compatible with SSR. The@nuxt/icon module handles server-side rendering automatically, ensuring icons are displayed correctly on both server and client.