Icon 图标

Element Ultra 提供了一套常用的图标集合。

使用图标

安装

使用包管理器

# 选择一个你喜欢的包管理器

# NPM
$ npm install @element-plus/icons-vue
# Yarn
$ yarn add @element-plus/icons-vue
# pnpm
$ pnpm install @element-plus/icons-vue

基础用法

WARNING

由于 HTML 标准已经定义了一个名为 menu 的标签,如果你注册的 Menu 无法正常工作,则需要使用别名来渲染图标。

<!-- Use el-icon to provide attributes to SVG icon -->
<template>
  <div>
    <el-icon :size="size" :color="color">
      <edit></edit>
    </el-icon>
    <!-- Or use it independently without derive attributes from parent -->
    <edit></edit>
  </div>
</template>

结合 el-icon 使用

el-icon 为原始的 SVG 图标提供额外的属性,更多细节详见结尾。

<template>
  <p>
    with extra class <b>is-loading</b>, your icon is able to rotate 360 deg in 2
    seconds, you can also override this
  </p>
  <el-icon :size="20">
    <edit />
  </el-icon>
  <el-icon color="#409EFC" class="no-inherit">
    <share />
  </el-icon>
  <el-icon>
    <delete />
  </el-icon>
  <el-icon class="is-loading">
    <loading />
  </el-icon>
  <el-button type="primary">
    <el-icon style="vertical-align: middle;">
      <search />
    </el-icon>
    <span style="vertical-align: middle;"> Search </span>
  </el-button>
</template>

通过添加额外的类名 is-loading,你的图标就可以在 2 秒内旋转 360 度,但让你也可以自己改写想要的动画。

直接使用 SVG 图标

<template>
  <div style="font-size: 20px;">
    <!-- Since svg icons do not carry any attributes by default -->
    <!-- You need to provide attributes directly -->
    <edit style="width: 1em; height: 1em; margin-right: 8px;" />
    <share style="width: 1em; height: 1em; margin-right: 8px;" />
    <delete style="width: 1em; height: 1em; margin-right: 8px;" />
    <search style="width: 1em; height: 1em; margin-right: 8px;" />
  </div>
</template>

图标集合

TIP

只要你安装了图标组件库,即可在任意版本中使用 SVG 图标

您可以点击图标复制代码

Copy icon code
  • AddLocation
  • Aim
  • AlarmClock
  • Apple
  • ArrowDown
  • ArrowDownBold
  • ArrowLeft
  • ArrowLeftBold
  • ArrowRight
  • ArrowRightBold
  • ArrowUp
  • ArrowUpBold
  • Avatar
  • Back
  • Baseball
  • Basketball
  • Bell
  • BellFilled
  • Bicycle
  • Bottom
  • BottomLeft
  • BottomRight
  • Bowl
  • Box
  • Briefcase
  • Brush
  • BrushFilled
  • Burger
  • Calendar
  • Camera
  • CameraFilled
  • CaretBottom
  • CaretLeft
  • CaretRight
  • CaretTop
  • Cellphone
  • ChatDotRound
  • ChatDotSquare
  • ChatLineRound
  • ChatLineSquare
  • ChatRound
  • ChatSquare
  • Check
  • Checked
  • Cherry
  • Chicken
  • ChromeFilled
  • CircleCheck
  • CircleCheckFilled
  • CircleClose
  • CircleCloseFilled
  • CirclePlus
  • CirclePlusFilled
  • Clock
  • Close
  • CloseBold
  • Cloudy
  • Coffee
  • CoffeeCup
  • Coin
  • ColdDrink
  • Collection
  • CollectionTag
  • Comment
  • Compass
  • Connection
  • Coordinate
  • CopyDocument
  • Cpu
  • CreditCard
  • Crop
  • DArrowLeft
  • DArrowRight
  • DCaret
  • DataAnalysis
  • DataBoard
  • DataLine
  • Delete
  • DeleteFilled
  • DeleteLocation
  • Dessert
  • Discount
  • Dish
  • DishDot
  • Document
  • DocumentAdd
  • DocumentChecked
  • DocumentCopy
  • DocumentDelete
  • DocumentRemove
  • Download
  • Drizzling
  • Edit
  • EditPen
  • Eleme
  • ElemeFilled
  • ElementPlus
  • Expand
  • Failed
  • Female
  • Files
  • Film
  • Filter
  • Finished
  • FirstAidKit
  • Flag
  • Fold
  • Folder
  • FolderAdd
  • FolderChecked
  • FolderDelete
  • FolderOpened
  • FolderRemove
  • Food
  • Football
  • ForkSpoon
  • Fries
  • FullScreen
  • Goblet
  • GobletFull
  • GobletSquare
  • GobletSquareFull
  • GoldMedal
  • Goods
  • GoodsFilled
  • Grape
  • Grid
  • Guide
  • Handbag
  • Headset
  • Help
  • HelpFilled
  • Hide
  • Histogram
  • HomeFilled
  • HotWater
  • House
  • IceCream
  • IceCreamRound
  • IceCreamSquare
  • IceDrink
  • IceTea
  • InfoFilled
  • Iphone
  • Key
  • KnifeFork
  • Lightning
  • Link
  • List
  • Loading
  • Location
  • LocationFilled
  • LocationInformation
  • Lock
  • Lollipop
  • MagicStick
  • Magnet
  • Male
  • Management
  • MapLocation
  • Medal
  • Memo
  • Menu
  • Message
  • MessageBox
  • Mic
  • Microphone
  • MilkTea
  • Minus
  • Money
  • Monitor
  • Moon
  • MoonNight
  • More
  • MoreFilled
  • MostlyCloudy
  • Mouse
  • Mug
  • Mute
  • MuteNotification
  • NoSmoking
  • Notebook
  • Notification
  • Odometer
  • OfficeBuilding
  • Open
  • Operation
  • Opportunity
  • Orange
  • Paperclip
  • PartlyCloudy
  • Pear
  • Phone
  • PhoneFilled
  • Picture
  • PictureFilled
  • PictureRounded
  • PieChart
  • Place
  • Platform
  • Plus
  • Pointer
  • Position
  • Postcard
  • Pouring
  • Present
  • PriceTag
  • Printer
  • Promotion
  • QuartzWatch
  • QuestionFilled
  • Rank
  • Reading
  • ReadingLamp
  • Refresh
  • RefreshLeft
  • RefreshRight
  • Refrigerator
  • Remove
  • RemoveFilled
  • Right
  • ScaleToOriginal
  • School
  • Scissor
  • Search
  • Select
  • Sell
  • SemiSelect
  • Service
  • SetUp
  • Setting
  • Share
  • Ship
  • Shop
  • ShoppingBag
  • ShoppingCart
  • ShoppingCartFull
  • ShoppingTrolley
  • Smoking
  • Soccer
  • SoldOut
  • Sort
  • SortDown
  • SortUp
  • Stamp
  • Star
  • StarFilled
  • Stopwatch
  • SuccessFilled
  • Sugar
  • Suitcase
  • SuitcaseLine
  • Sunny
  • Sunrise
  • Sunset
  • Switch
  • SwitchButton
  • SwitchFilled
  • TakeawayBox
  • Ticket
  • Tickets
  • Timer
  • ToiletPaper
  • Tools
  • Top
  • TopLeft
  • TopRight
  • TrendCharts
  • Trophy
  • TrophyBase
  • TurnOff
  • Umbrella
  • Unlock
  • Upload
  • UploadFilled
  • User
  • UserFilled
  • Van
  • VideoCamera
  • VideoCameraFilled
  • VideoPause
  • VideoPlay
  • View
  • Wallet
  • WalletFilled
  • WarnTriangleFilled
  • Warning
  • WarningFilled
  • Watch
  • Watermelon
  • WindPower
  • ZoomIn
  • ZoomOut

Icon 属性

属性说明类型可选值默认值
colorsvg 的 fill 颜色Pick<CSSProperties, 'color'>-inherit
sizeSVG 图标的大小,size x sizenumber/string-

Icon 插槽

名称说明
自定义默认内容