@boringer-avatars/vue3

中文文档
0.2.1发布于 2023/02/22MITTypeScriptESM + CJS零依赖近 30 天下载 8411

Procedurally generate Avatars for your applications. Use these avatars as placeholders until your users upload their own images. Several variants and styles to choose from.

原始使用文档
文档目录7 节
  1. Warning: Generated Code
  2. Installation
  3. Usage
  4. Props
  5. Required
  6. Optional
  7. License

@boringer-avatars/vue3

Procedurally generate Avatars for your applications. Use these avatars as placeholders until your users upload their own images. Several variants and styles to choose from.

Warning: Generated Code

This library is generated using [Mitosis](https://github.com/BuilderIO/mitosis).

This repo is forked from boring-avatars. It aims to create cross-framework implementations for as many frameworks as possible. (Angular, React, Vue, Solid, Svelte, Qwik, etc).

Installation

npm install @boringer-avatars/vue3
# or
yarn add @boringer-avatars/vue3
# or
pnpm add @boringer-avatars/vue3

Usage

<script setup>
          import { Avatar } from "@boringer-avatars/vue3";
        </script>

        <template>
          <Avatar
            :title="false"
            :size="400"
            variant="beam"
            name="testing"
            :square="false"
            :colors="['#FFAD08', '#EDD75A', '#73B06F', '#0C8F8F', '#405059']"
          />
        </template>

Props

The options you can pass into the component are listed below.

Required

  • name: string. name is used to determine the exact drawing of each avatar. This is what makes it different for each user. You can also use ID values rather than names. This is the only required value.

Optional

  • variant: Variant. Determines the style of avatar. Valid values include: "pixel", "bauhaus", "ring", "beam", "sunset", "marble". Defaults to "beam".

  • colors: string[]. An array of valid Hex colors. 5 different colors is the optimal amount. More or less will still work. Defaults to: ["#92A1C6", "#146A7C", "#F0AB3D", "#C271B4", "#C20D90"].

  • square: boolean. Decides whether Avatar is a Circle or Square. Defaults to: false

  • hasTitle: boolean. Decides whether Avatar displays a title value. Defaults to: false

  • size: string. Determines the width and height of the image. You can use any valid css value. eg: "42px", "42%", "42vw", etc. Defaults to: 42px

License

MIT License

Copyright (c) 2021 boringdesigners

Copyright (c) 2022-2023 cmgriffing

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

版本与发布记录

@boringer-avatars/vue3 共发布 4 个版本,首次发布于 2022/09/28;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.2.1latest2023/02/223 年前
0.2.02023/02/223 年前
0.1.02023/01/073 年前
0.0.02022/09/284 年前

关于 @boringer-avatars/vue3 的常见问题

@boringer-avatars/vue3 是什么?

Procedurally generate Avatars for your applications. Use these avatars as placeholders until your users upload their own images. Several variants and styles to choose from.

如何安装 @boringer-avatars/vue3?

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

@boringer-avatars/vue3 支持 TypeScript 吗?

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

@boringer-avatars/vue3 支持 ESM 还是 CommonJS?

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

@boringer-avatars/vue3 可以商用吗?

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

@boringer-avatars/vue3 的下载量有多少?

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

@boringer-avatars/vue3 还在维护吗?

最新版本 0.2.1 发布于 2023/02/22(3 年前);至今共发布 4 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/09/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。