Skip to content

@jview/icons提供语义化的矢量图标组件,图标素材源于 Feather Icons 开源项目。

图标集合是一个独立的 npm 包,因此你需要安装@jview/icons图标库。

每个图标都是一个单组件,支持按需使用,你完全不用担心项目体积因为引入一个图标库而增大许多。

如果您认为@jview/icons图标库不能满足需求,可以选择@jview/icons-antd,这是 JView UI 官方封装的另一个图标库,图标素材来源于Ant Design,同样支持单组件按需使用。

如果您希望使用 iconfont 图标,我们也同样支持,具体见下方的使用iconfont图标

安装图标组件包

bash
npm install @jview/icons
// OR
yarn add @jview/icons
// OR
pnpm add @jview/icons
npm install @jview/icons
// OR
yarn add @jview/icons
// OR
pnpm add @jview/icons

使用图标

  1. 引入一个图标。
js
import { ArrowDownLeft } from "@jview/icons"
import { ArrowDownLeft } from "@jview/icons"
  1. 模板中使用图标。
html
<ArrowDownLeft />
<ArrowDownLeft />

图标集合

点击图标可复制代码。

Activity
Airplay
AlertCircle
AlertOctagon
AlertTriangle
AlignCenter
AlignJustify
AlignLeft
AlignRight
Anchor
Aperture
Archive
ArrowDownCircle
ArrowDownLeft
ArrowDownRight
ArrowDown
ArrowLeftCircle
ArrowLeft
ArrowRightCircle
ArrowRight
ArrowUpCircle
ArrowUpLeft
ArrowUpRight
ArrowUp
AtSign
Award
BarChart2
BarChart
BatteryCharging
Battery
BellOff
Bell
Bluetooth
Bold
BookOpen
Book
Bookmark
Box
Briefcase
Calendar
CameraOff
Camera
Cast
CheckCircle
CheckSquare
Check
ChevronDown
ChevronLeft
ChevronRight
ChevronUp
ChevronsDown
ChevronsLeft
ChevronsRight
ChevronsUp
Chrome
Circle
Clipboard
Clock
CloudDrizzle
CloudLightning
CloudOff
CloudRain
CloudSnow
Cloud
Code
Codepen
Codesandbox
Coffee
Columns
Command
Compass
Copy
CornerDownLeft
CornerDownRight
CornerLeftDown
CornerLeftUp
CornerRightDown
CornerRightUp
CornerUpLeft
CornerUpRight
Cpu
CreditCard
Crop
Crosshair
Database
Delete
Disc
DivideCircle
DivideSquare
Divide
DollarSign
DownloadCloud
Download
Dribbble
Droplet
Edit2
Edit3
Edit
ExternalLink
EyeOff
Eye
Facebook
FastForward
Feather
Figma
FileMinus
FilePlus
FileText
File
Film
Filter
Flag
FolderMinus
FolderPlus
Folder
Framer
Frown
Gift
GitBranch
GitCommit
GitMerge
GitPullRequest
Github
Gitlab
Globe
Grid
HardDrive
Hash
Headphones
Heart
HelpCircle
Hexagon
Home
Image
Inbox
Info
Instagram
Italic
Key
Layers
Layout
LifeBuoy
Link2
Link
Linkedin
List
Loader
Lock
LogIn
LogOut
Mail
MapPin
Map
Maximize2
Maximize
Meh
Menu
MessageCircle
MessageSquare
MicOff
Mic
Minimize2
Minimize
MinusCircle
MinusSquare
Minus
Monitor
Moon
MoreHorizontal
MoreVertical
MousePointer
Move
Music
Navigation2
Navigation
Octagon
Package
Paperclip
PauseCircle
Pause
PenTool
Percent
PhoneCall
PhoneForwarded
PhoneIncoming
PhoneMissed
PhoneOff
PhoneOutgoing
Phone
PieChart
PlayCircle
Play
PlusCircle
PlusSquare
Plus
Pocket
Power
Printer
Radio
RefreshCcw
RefreshCw
Repeat
Rewind
RotateCcw
RotateCw
Rss
Save
Scissors
Search
Send
Server
Settings
Share2
Share
ShieldOff
Shield
ShoppingBag
ShoppingCart
Shuffle
Sidebar
SkipBack
SkipForward
Slack
Slash
Sliders
Smartphone
Smile
Speaker
Square
Star
StopCircle
Sun
Sunrise
Sunset
Table
Tablet
Tag
Target
Terminal
Thermometer
ThumbsDown
ThumbsUp
ToggleLeft
ToggleRight
Tool
Trash2
Trash
Trello
TrendingDown
TrendingUp
Triangle
Truck
Tv
Twitch
Twitter
Type
Umbrella
Underline
Unlock
UploadCloud
Upload
UserCheck
UserMinus
UserPlus
UserX
User
Users
VideoOff
Video
Voicemail
Volume1
Volume2
VolumeX
Volume
Watch
WifiOff
Wifi
Wind
XCircle
XOctagon
XSquare
X
Youtube
ZapOff
Zap
ZoomIn
ZoomOut

使用iconfont图标

如果您是 iconfont.cn 的用户,我们提供了createIconFont方法,可以轻松创建一个IconFont组件,接着指定ico属性即可使用 iconfont 项目中的图标。

展开查看代码
vue
<template>
    <j-space>
        <IconFont ico="layers" />
        <IconFont ico="lock" />
        <IconFont ico="fullscreen-expand" />
    </j-space>
</template>

<script setup>
import { createIconFont } from '@jview/icons'

const IconFont = createIconFont({ scriptUrl: '//at.alicdn.com/t/c/font_3736402_d50r1yq40hw.js', icoPrefix: 'vp-icon-' })
</script>
<template>
    <j-space>
        <IconFont ico="layers" />
        <IconFont ico="lock" />
        <IconFont ico="fullscreen-expand" />
    </j-space>
</template>

<script setup>
import { createIconFont } from '@jview/icons'

const IconFont = createIconFont({ scriptUrl: '//at.alicdn.com/t/c/font_3736402_d50r1yq40hw.js', icoPrefix: 'vp-icon-' })
</script>

属性

参数说明类型默认值必填
size图标大小number
color图标颜色string
spin开启旋转动画boolean
rotate设置旋转角度,不能与spin同时使用number
onClick点击事件回调(event: MouseEvent) => void