@astraicons/vue

中文文档
1.7.0发布于 2025/12/31MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 7117

A comprehensive icon set designed for websites, applications, social networks, and print media, tailored specifically for UI Astra.

原始使用文档
文档目录24 节
  1. Installation
  2. Usage
  3. Icon Styles
  4. Linear (288 icons)
  5. Bold (288 icons)
  6. Duotone (288 icons)
  7. Brand (18 icons)
  8. 3D (32 icons)
  9. Props
  10. Examples
  11. With Tailwind CSS
  12. With inline styles
  13. In a button
  14. With Vue 3 Composition API
  15. TypeScript Support
  16. Tree Shaking
  17. Package Info
  18. Available Icons
  19. Browser Support
  20. Contributing
  21. Related Packages
  22. Credits
  23. License
  24. Links

@astraicons/vue

AstraIcons

Beautiful Vue 3 icons from the Astra Icons collection. 900+ icons across 5 styles.

npm version npm downloads License

Installation

npm install @astraicons/vue
# or
yarn add @astraicons/vue
# or
pnpm add @astraicons/vue

Usage

Import icons from their respective style directories:

<template>
  <div>
    <HomeIcon class="w-6 h-6" />
    <HeartIcon class="w-6 h-6 text-red-500" />
    <StarIcon class="w-6 h-6 text-yellow-500" />
    <AppleIcon class="w-8 h-8" />
    <CubeIcon class="w-8 h-8 text-purple-500" />
  </div>
</template>

<script setup>
import { HomeIcon } from '@astraicons/vue/linear';
import { HeartIcon } from '@astraicons/vue/bold';
import { StarIcon } from '@astraicons/vue/duotone';
import { AppleIcon } from '@astraicons/vue/brand';
import { CubeIcon } from '@astraicons/vue/3d';
</script>

Icon Styles

Linear (288 icons)

Outline icons with 1.5px stroke width. Perfect for modern, minimalist interfaces.

import { ActivityIcon, BellIcon, CameraIcon } from '@astraicons/vue/linear';

Bold (288 icons)

Filled or bold stroke icons for emphasis and better visibility at smaller sizes.

import { ActivityIcon, BellIcon, CameraIcon } from '@astraicons/vue/bold';

Duotone (288 icons)

Two-tone icons that combine filled and outline styles for depth and visual interest.

import { ActivityIcon, BellIcon, CameraIcon } from '@astraicons/vue/duotone';

Brand (18 icons)

Company and service logos including social media platforms and popular brands.

import { AppleIcon, GoogleIcon, TwitterIcon } from '@astraicons/vue/brand';

3D (32 icons)

Modern three-dimensional style icons with depth and perspective for contemporary interfaces.

import { CubeIcon, FolderIcon, BoxIcon } from '@astraicons/vue/3d';

Props

All icons are functional components that accept standard HTML attributes:

<template>
  <HomeIcon 
    class="custom-class"
    :style="{ color: 'blue' }"
    @click="handleClick"
    role="img"
    aria-label="Home"
  />
</template>

Examples

With Tailwind CSS

<template>
  <HomeIcon class="w-8 h-8 text-blue-500 hover:text-blue-600 transition-colors" />
</template>

With inline styles

<template>
  <HomeIcon :style="{ width: '32px', height: '32px', color: '#3B82F6' }" />
</template>

In a button

<template>
  <button class="flex items-center gap-2 px-4 py-2 bg-blue-500 text-white rounded">
    <SaveIcon class="w-5 h-5" />
    Save Changes
  </button>
</template>

<script setup>
import { SaveIcon } from '@astraicons/vue/linear';
</script>

With Vue 3 Composition API

<template>
  <component :is="currentIcon" class="w-6 h-6" />
</template>

<script setup>
import { ref, computed } from 'vue';
import { HomeIcon, SettingsIcon } from '@astraicons/vue/linear';

const isHome = ref(true);
const currentIcon = computed(() => isHome.value ? HomeIcon : SettingsIcon);
</script>

TypeScript Support

All icons are fully typed. TypeScript will provide autocomplete for all available icons.

<script setup lang="ts">
import { HomeIcon } from '@astraicons/vue/linear';
import type { FunctionalComponent } from 'vue';

const MyIcon: FunctionalComponent = HomeIcon;
</script>

Tree Shaking

This package is optimized for tree shaking. Only the icons you import will be included in your bundle.

// ✅ Good - only imports what you need
import { HomeIcon } from '@astraicons/vue/linear';

// ❌ Avoid - imports entire style directory
import * as Icons from '@astraicons/vue/linear';

Package Info

  • Package Size: ~14MB total (unpacked)
  • Files: 3,524 files (JS + TypeScript definitions)
  • Tree-shakeable: Yes - only imported icons are bundled
  • Peer Dependencies: Vue >= 3

Available Icons

View the complete list of icons:

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Contributing

We welcome contributions to enhance the project. Our current focus:

  • ✅ Bug fixes for existing icons
  • ✅ TypeScript improvements
  • ✅ Documentation updates
  • ❌ New icon contributions (not accepted at this time)

Credits

License

MIT © UI Astra

版本与发布记录

@astraicons/vue 共发布 49 个版本,首次发布于 2024/06/13;过去 12 个月发布了 12 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.7.0latest2025/12/3110 个月前
1.6.92025/12/3010 个月前
1.6.82025/12/2910 个月前
1.6.72025/12/2610 个月前
1.6.62025/12/0810 个月前
1.6.52025/12/0711 个月前

关于 @astraicons/vue 的常见问题

@astraicons/vue 是什么?

A comprehensive icon set designed for websites, applications, social networks, and print media, tailored specifically for UI Astra.

如何安装 @astraicons/vue?

在项目目录运行 npm install @astraicons/vue,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(>= 3)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@astraicons/vue 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@astraicons/vue 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@astraicons/vue 可以商用吗?

@astraicons/vue 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@astraicons/vue 的下载量有多少?

根据 npm 官方下载统计,@astraicons/vue 在 2026/10/07 – 2026/11/05 这 30 天内被下载 7,117 次,日均约 237 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@astraicons/vue 还在维护吗?

最新版本 1.7.0 发布于 2025/12/31(10 个月前);至今共发布 49 个版本,其中过去 12 个月发布了 12 个;首次发布于 2024/06/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。