Skip to content

Icon

A font based icon set that includes icons from most common scenarios. It is easy to use and can be used out of the box, without the need to write the style of each icon yourself. Simply configure it. Support custom (including nvue) text and image icons.

Platform compatibility

App(vue)App(nvue)H5小程序VUE2VUE3

Basic usage

Call through the form of <wu-icon> and set the name parameter to the icon name. Where color defaults to #606266 and size defaults to 16px

vue
<wu-icon name="photo"></wu-icon>
<wu-icon name="photo"></wu-icon>

Modifying the Style of Icons

  • Modify the color of the icon through the color parameter
  • Modify the size of the icon using the size parameter, in px
vue
<wu-icon name="photo" color="# 2979ff" size="28"></wu-icon>
<wu-icon name="photo" color="# 2979ff" size="28"></wu-icon>

Picture icon

The image icon mentioned here refers to a small icon that functions as an "icon" icon, rather than a large-sized image to display the scene. In theory, this small icon should be a square icon in the format of png.

Usage: Pass in an image link to the name parameter of the component to display the font icon. The link rule is based on the / slash or base64 image address, and the size parameter is also set to the width of the image icon. Since it is an image, parameters such as color will become invalid.

vue
<!-- Online address-->
<wu-icon size="40" name="https://via.placeholder.com/50x50.png/3c9cff/fff"></wu-icon>
<!-- Base64 address icon, for demonstration only -->
<wu-icon size="40" name="data: image/png; base64,..."></wu-icon>
<!-- Online address-->
<wu-icon size="40" name="https://via.placeholder.com/50x50.png/3c9cff/fff"></wu-icon>
<!-- Base64 address icon, for demonstration only -->
<wu-icon size="40" name="data: image/png; base64,..."></wu-icon>

Custom Icon

For details, please refer to Custom Icon Library

API

Icon Props

Property NameDescriptionTypeDefault ValueOptional Value
nameIcon name. If it contains / or follows the base64 image format, it will be considered as an image icon, and the related attributes of the text icon will be invalidatedString--
colorIcon color, can receive theme colors: color="primary"String#606266-
sizeIcon font size, in px (rpx)String/Number16px-
boldWhether to display boldBooleanfalsetrue/false
indexA value used to distinguish multiple icons, which is passed out through the click event when clicking on an iconString/Number--
hoverClassThe style class for pressing down the icon, with the same usage as the hover class parameter in the view component of Uni. For details, please refer to: hover classString--
customPrefixWhen customizing a font icon library, this value needs to be written. Please refer to Custom Icon LibraryBooleanfalsetrue/false
labelThe label text of the iconString/Number--
labelPoslabel Position relative to iconStringrighttop/bottom/left/right
labelSizelabel Font size, in px (rpx)String/Number15px-
labelColorlabel Font ColorString#606266-
spacelabel The distance from the icon, in px (rpx)String/Number3px-
imgModeThe mode of the image component, see: imageString/Number3px-
widthname is the width of the image path, in px (rpx)String/Number--
heightname is the height of the image when it is in the image path, in px (rpx)String/Number--
topThe positioning of icons in the vertical direction is used to solve certain situations, where the purpose unit px (rpx)String/Number0-
stopWhether to block event propagationBooleanfalsetrue/false

Icon Events

Event NameDescriptionCallback Parameters
clickTrigger when clicking on the iconindex: The index value passed through props

Icon collection (click icon to obtain icon code)

level

download

search

reload

scan

calendar

bag

checkbox-mark

attach

wifi-off

woman

man

chat

chat-fill

red-packet

folder

order

arrow-up-fill

arrow-down-fill

backspace

photo

photo-fill

lock

lock-fill

lock-open

lock-opened-fill

home

home-fill

star

star-fill

share

share-fill

share-square

volume

volume-fill

volume-off

volume-off-fill

trash

trash-fill

shopping-cart

shopping-cart-fill

question-circle

question-circle-fill

plus

plus-circle

plus-circle-fill

tags

tags-fill

pause

pause-circle

pause-circle-fill

play-circle

play-circle-fill

map

map-fill

phone

phone-fill

list

list-dot

info-circle

info-circle-fill

minus

minus-circle

mic

mic-off

grid

grid-fill

eye

eye-fill

eye-off

eye-off-outline

file-text

file-text-fill

edit-pen

edit-pen-fill

email

email-fill

checkmark

checkmark-circle

checkmark-circle-fill

clock

clock-fill

close

close-circle

close-circle-fill

car

car-fill

bell

bell-fill

play-left

play-right

play-left-fill

play-right-fill

skip-back-left

skip-forward-right

setting

setting-fill

more-dot-fill

more-circle

more-circle-fill

arrow-upward

arrow-downward

arrow-leftward

arrow-rightward

arrow-up

arrow-down

arrow-left

arrow-right

thumb-up

thumb-up-fill

thumb-down

thumb-down-fill

coupon

coupon-fill

kefu-ermai

server-fill

server-man

warning

warning-fill

camera

camera-fill

pushpin

pushpin-fill

heart

heart-fill

account

account-fill

integral

integral-fill

gift

gift-fill

empty-data

empty-address

empty-favor

empty-car

empty-order

empty-list

empty-search

empty-permission

empty-news

empty-history

empty-coupon

empty-page

apple-fill

zhifubao-circle-fill

weixin-circle-fill

weixin-fill

qq-fill

qq-circle-fill

moments

moments-circel-fill

twitter

twitter-circle-fill