# Icon ### Intro Install the [@nutui/icons-vue](https://github.com/jd-opensource/nutui-icons) package independently. Two usage modes are provided (SVG on-demand usage and IconFont full usage). ### Install ```bash npm i --save @nutui/icons-vue ``` ## Use: SVG import on demand Use mode of on-demand loading components, see @nutui/icons-vue/dist/types/index.d.ts ```js import { Add } from '@nutui/icons-vue' // template ; ``` ``` The SVG used internally in the component library is Loading,Location,Location2,Check,Close,Left,Service,Top,Right,CheckNormal,Checked,CheckDisabled,DownArrow,JoySmile,Image,ImageError,CircleClose,MaskClose,Minus,Plus,ArrowUp2,ArrowDown2,Notice,CheckChecked,StarN,Tips,Loading1,TriangleUp,TriangleDown,Photograph,Failure,Del,Link,Download ``` ### Props | Attribute | Description | Type | Default | | --- | --- | --- | --- | | name | Icon name or URL | string | - | | color | Icon color | string | - | | width | Icon size , eg `20px` `2em` `2rem` | string \| object | - | | height | Icon size , eg `20px` `2em` `2rem` | string \| object | - | ### Events | Event | Description | Arguments | | --- | --- | --- | | click | Emitted when icon is clicked | event: Event | ## Use: Full use of IconFont ```js import { createApp } from 'vue' import { IconFont } from '@nutui/icons-vue' import '@nutui/icons-vue/dist/style_iconfont.css' const app = createApp() app.use(IconFont) ``` Use `name` prop to set icon name or icon URL. :::demo ```vue ``` ::: ### Icon Color Use `color` prop to set icon color. :::demo ```vue ``` ::: ### Icon Size Use `size` prop to set icon size default unit is `px` . :::demo ```vue ``` ::: ### Universal motion icons Adding the specified class class can realize the dynamic effect of the picture. The default is to play once, and adding the `nut-icon-am-infinite` class can realize the loop playback. By setting css, the delay interval before the animation starts, and how long the animation will be completed :::demo ```vue ``` ::: ### Props | Attribute | Description | Type | Default | | --- | --- | --- | --- | | name | Icon name or URL | string | - | | color | Icon color | string | - | | size | Icon size , eg `20px` `2em` `2rem` | string \| object | - | | font-class-name | Custom icon font base class name | string | `nutui-iconfont` | | class-prefix | Custom icon class name prefix for using custom icons | string | `nut-icon` | | tag | HTML Tag of root element | string | `i` | ### Events | Event | Description | Arguments | | --- | --- | --- | | click | Emitted when icon is clicked | event: Event | ## Use: other icons The number of icons provided by `@nutui/icons-vue` itself is limited. If it cannot meet the needs, you can consider using a more versatile and larger number of icon libraries. - Recommended icon format: SVG - Recommended icon library: [iconify](https://iconify.design/), which provides more than 150,000 open source icons. - Recommended icon scheme: [unplugin-icons](https://github.com/antfu/unplugin-icons), which provides a way to introduce `iconify` on demand.