Overview
TheuseIcon() composable provides icon resolution functionality, supporting multiple icon sets, SVG paths, icon aliases, and component-based icons.
Import
Signature
Parameters
Icon value to resolve. Can be:
- String: icon name, alias, or class
- Array: SVG path data
- Component: icon component
- Ref/Getter: reactive icon value
Return Value
Computed icon instance containing:
component- The appropriate icon component to render (VComponentIcon, VSvgIcon, VLigatureIcon, or VClassIcon)icon- The resolved icon value
Icon Types
String Icons
SVG Path Icons
Component Icons
Icon Aliases
Vuetify provides built-in icon aliases:Usage Examples
Basic Icon Resolution
Using Icon Aliases
SVG Path Icons
Multiple Icon Sets
Component-Based Icons
Dynamic Icons
Icon with Opacity
Icon Components
The composable automatically selects the appropriate component:VComponentIcon
Used for JSX/component-based iconsVSvgIcon
Used for SVG path arraysVLigatureIcon
Used for ligature-based icon fonts (Material Icons)VClassIcon
Used for class-based icon fonts (Font Awesome, MDI)Notes
- Must be called within a component setup function or composable
- Throws an error if the Vuetify icons provider is not found
- Icon resolution is reactive and updates when the icon value changes
- Aliases are defined at the application level via Vuetify configuration
- Icon sets can be configured globally via the
iconsoption