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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-animals

v0.0.81

Published

A customizable animal avatar Vue component, based on the avatars used by Google Docs.

Downloads

11

Readme

vue-animals

Vue Animals

A Vue component to add customizable animal avatars to any project. Inspired by the Google Docs "Anonymous Animals", all images designed by Jefferson Cheng and property of Google. Images from Github repo by wayou.

Installation Process

Install from NPM:

npm install vue-animals

Register the component globally (inside main.js):

import animal from "vue-animals";
Vue.component("v-animal", animal);

...or register the component locally (preferred):

import animal from "vue-animals";
export default {
  components: {
    "v-animal": animal
  }
};

Once you've successfully added a component, simply add it to a file:

<v-animal />

By default, this avatar is circular, 70px wide, and has a random color and animal. The available customizations are below.

Select an Animal

Animals

To specify an animal, use the name prop:

<v-animal name="alligator" />

If you provide an invalid name, a random name will be used by default and a console error will be thrown. A full list of animals is available here.

Select a Color

Colors

To specify an color, use the color prop:

<!--Use a predefined color-->
<v-animal color="red" />
<!--Use a hex-code -->
<v-animal color="#856EE7" />

For colors, you may use pre-selected colors like red, orange, yellow, green, purple, teal (all dark-mode friendly), or you may use none for a transparent background. You can also provide a valid CSS hexcode as well. If you provide an invalid color, a random color will be used by default and a console error will be thrown.

Select a Size

Sizes

To specify a size, use the size prop:

<v-animal size="100px" />
<v-animal size="10vw" />
<v-animal size="25%" />

Although pixel (px units) are preferred, this component supports any valid CSS width unit. By design, the height and width of the avatar will be the same. If you provide an invalid CSS width, a standard width of 70px will be used instead and a console error will be thrown. The max-width and height are 200px (to preserve image quality)

Select a Shape

Sizes

To specify a shape, you'll need to provide a particular shape prop:

<!--Use default circular shape, no prop needed-->
<v-animal />
<!--Use a rounded square -->
<v-animal rounded />
<!--Use a normal square -->
<v-animal square />

If you provide both a square and rounded prop, the rounded option will be preferred. By default, all avatars will be circular.

Dance!

Dance

To animate an avatar, use the dance prop:

<!--Use default circular shape, no prop needed-->
<v-animal dance />

This will make the avatar do a repeated dancing animation. You can apply this prop dynamically so that an avatar selectively dances (such as when a cursor is hovering over it).

All customizations

Below are some examples of vue-animals that use multiple customization props at once:

<!--Alligator image, rounded square shape, random color, 70px size-->
<v-animal name="alligator" rounded />

<!--Elephant image, square shape, blue color, 50px size-->
<v-animal name="elephant" color="blue" size="50px" square />

<!--Animated dolphin image, circular shape, orange color, 80px size-->
<v-animal name="dolphin" color="orange" size="80px" dance />

You can also add your own customizations by adding CSS classes, ID, or styles:

<v-animal name="alligator" rounded class="my-custom-css" style="..." />

Lastly, all props can be dynamically generated using computed properties

<v-animal :name="animalVar" :rounded="isRounded" />