📄

Auto-Generate Cute Avatar Icons in React!

This article was automatically translated from theJapanese original by AI. It may contain translation errors.

This post was published over 2 years ago. Its content may be outdated.

Introduction

I’ll introduce “boring-avatars,” a library for automatically generating cute avatar icons in React.

Usage

It’s very simple!

npm install boring-avatars
import Avatar from "boring-avatars";

const App = () => (
  <Avatar
    name="some random string"
    size={40}
    variant="marble"
  />
);

The avatar icon changes depending on the string you put in name. If you set this to something like a username, you can automatically generate an avatar icon based on the username. The available variants are marble, beam, pixel, sunset, ring, and bauhaus. Let’s look at a sample of each.

You can also try out samples on this site!

marble

marble

beam

beam

pixel

pixel

sunset

sunset

ring

ring

bauhaus

bauhaus

Conclusion

I hope this helps as a reference when building a web service.

Recent Articles

Network(beta)

Drag to move / Ctrl+wheel to zoom