@ boxicons/ vue (帮助)
Vue 3 图标库由 Boxicons SVG 文件所建,全树摇动支持.
安装
npm install @boxicons/vue
# or
yarn add @boxicons/vue
# or
pnpm add @boxicons/vue
使用量
基本用途
<script setup>
import { Alarm, Twitter, Home } from '@boxicons/vue';
</script>
<template>
<Alarm />
<Twitter />
<Home />
</template>
图标包
- 基础 - 大纲/正则样式图标(默认)
- 已填满 - 固态/填充式图标
- 品牌 - 品牌/标志
<template>
<Alarm />
<Alarm pack="filled" />
</template>
大小
大小预设
<template>
<Alarm size="xs" /> <!-- 16px -->
<Alarm size="sm" /> <!-- 20px -->
<Alarm size="base" /> <!-- 24px (default) -->
<Alarm size="md" /> <!-- 36px -->
<Alarm size="lg" /> <!-- 48px -->
<Alarm size="xl" /> <!-- 64px -->
<Alarm size="2xl" /> <!-- 96px -->
<Alarm size="3xl" /> <!-- 128px -->
<Alarm size="4xl" /> <!-- 256px -->
<Alarm size="5xl" /> <!-- 512px -->
</template>
自定义大小
<template>
<Alarm :width="32" :height="32" />
<Alarm width="2rem" height="2rem" />
</template>
颜色
<template>
<Alarm fill="#ff0000" />
<Alarm fill="currentColor" />
</template>
不透明度
<template>
<Alarm :opacity="0.5" />
</template>
翻转
<template>
<Alarm flip="horizontal" />
<Alarm flip="vertical" />
</template>
旋转
<template>
<Alarm :rotate="45" />
<Alarm rotate="90deg" />
</template>
删除铺设
<template>
<Alarm remove-padding />
</template>
组合道具
<template>
<Alarm
pack="filled"
fill="#ffffff"
:opacity="0.8"
size="lg"
flip="horizontal"
:rotate="45"
class="my-icon"
/>
</template>
树摇
只有导入的图标被捆绑 :
// ✅ Only Alarm is bundled
import { Alarm } from '@boxicons/vue';
可用图标
- 1884 (英语) 基本(外线)图标
- 1884 (英语) 已填入图标
- 295个 品牌图标
类型脚本
import type { BoxIconProps, IconPack, IconSize, FlipDirection } from '@boxicons/vue';
许可证
麻省理工学院