🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

vue-avatar-gradient

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
v

vue-avatar-gradient

Generate beautiful gradient avatars for your Vue application.

1.0.9
latest
69

Supply Chain Security

100

Vulnerability

99

Quality

88

Maintenance

100

License

Unpopular package

Quality

This package is not very popular.

Found 1 instance in 1 package

Version published
Weekly downloads
22
69.23%
Maintainers
1
Weekly downloads
 
Created
Issues
0

Vue Avatar Gradient

npm version

Generate beautiful gradient avatars for your Vue application.

A lightweight Vue 3 component that renders a customizable gradient avatar based on a token string. Ideal for user avatars, placeholders, or generated profile images.

Inspired by Vercel Avatar.

Features

  • Deterministic Gradients: Generates the same gradient for a given token.
  • Customizable Size & Shape: Adjust size and rounded props.
  • Optional Text: Display initials or labels inside the avatar.
  • Easy Integration: Supports plugin installation or direct component import.

Installation

Install the package and its peer dependency:

npm install vue-avatar-gradient
# or
yarn add vue-avatar-gradient

Import Component

import { Avatar } from 'vue-avatar-gradient'

Usage

Provide a username to generate an avatar. Each name will generate a unique avatar. Just replace TOKEN with an username or email:

<Avatar token="TOKEN"/>

Avatar for TOKEN

Adjust Roundness

<Avatar token="TOKEN" :round="60"/>

Avatar for TOKEN

Custom Size

<Avatar token="TOKEN" :size="30"/>

Avatar for TOKEN

Add Initials

Add the text parameter:

<Avatar token="TOKEN" text="EU"/>

Avatar for TOKEN

Props

PropTypeDefaultDescription
tokenStringRequired. Unique string to generate hash
sizeNumber50Width and height of the SVG avatar (px)
roundedNumber0Corner radius for rounded avatars (px)
textString''Optional text (e.g., initials) inside avatar

Development & Build

  • Build: Uses Vite to produce ESM and UMD bundles:

    npm run build
    

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check issues.

License

MIT

FAQs

Package last updated on 17 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts