npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

astro-ui-avatars

v1.0.0

Published

Generate customizable user avatars with initials from names

Readme

🧔 Astro UI Avatars

version downloads github actions typescript makepr

This Astro package provides a component to generate user avatars with initials from names.

📦 Installation

Install using pnpm:

pnpm add astro-ui-avatars

Or using npm:

npm install astro-ui-avatars

Or using yarn:

yarn add astro-ui-avatars

🥑 Usage

To generate a user avatar in any of your Astro pages or components, import the Avatar component from astro-ui-avatars and use it inside your HTML:

---
import { Avatar } from 'astro-ui-avatars';
---

<html lang="en">
  <body>
    <p>User Avatar:</p>
    <Avatar name="John Doe" />
  </body>
</html>

🎨 Examples

  • Generate an avatar with default settings
<Avatar name="John Doe" />
  • Generate a blue avatar
<Avatar background="#0D8ABC" color="#fff" />
  • Generate a random background avatar
<Avatar background="random" />
  • Generate a rounded avatar
<Avatar rounded={true} />

📖 API Reference

| Name | Required | Default | Description | | :----------- | :------: | :--------- | :-------------------------------------------------------------- | | name | false | John Doe | The name used to generate initials. | | size | false | 64 | The size of the avatar in pixels. | | background | false | #007bff | The background color of the avatar. | | color | false | #FFFFFF | The text color of the avatar. | | length | false | 2 | The number of initials to display. | | fontSize | false | 0.5 | The font size of the initials in percentage. Between 0.1 and 1. | | rounded | false | true | Whether the avatar should have rounded corners. | | uppercase | false | true | Whether the initials should be in uppercase. | | bold | false | true | Whether the initials should be bold. |

All Avatar props are optional. If no props are provided, the avatar will use default settings.

Note

We have also setup an example repository available here: playground

Changelog

Please see the changelog for more information on recent changes.

Acknowledgements

Astro UI Avatars is heavily inspired by ui-avatars.com. Thanks ❤️