Skip to content

Icon ​

Lucide 图标包装。@lucide/vue 为 peer,库不打包具体图标。

基础 ​

vue
<script setup lang="ts">
import { Search } from '@lucide/vue'
import { HIcon } from 'happier-ui'
</script>

<template>
  <h-icon :icon="Search" size="md" />
  <h-icon :icon="Search" :size="32" />
</template>

描边与填充 ​

Lucide 非正式 filled 集,variant="fill" 效果因图标而异。

vue
<h-icon :icon="Star" variant="fill" color="var(--h-color-primary)" aria-label="收藏" />

API ​

Props ​

名称类型默认说明
iconComponent—必填;Lucide Vue 组件
variant'stroke' | 'fill''stroke'描边 / 填充倾向
size'sm' | 'md' | 'lg' | number'md'sm=16 / md=20 / lg=24;数字为 px
strokeWidthnumber2描边宽度
colorstring—颜色;默认 currentColor
ariaLabelstring—有意义图标的可访问名称

Slots ​

无。

Emits ​

无。

无障碍 ​

  • 装饰用途默认 aria-hidden
  • 有语义时传 ariaLabel(去掉 hidden,由组件处理命名)

MIT License