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

ngx-avatar-group

v1.0.4

Published

Simple package to add avatars like <b>image</b>, <b>letter</b> and <b>word</b> in the <b>Avatar stack</b>

Downloads

294

Readme

ngx-avatar-group

Simple package to add avatars like image, letter and word in the Avatar stack

Supports Angular v12 to v17

Installation

npm i ngx-avatar-group

Usage

  1. Import the NgxAvatarGroupModule in the app-module
import { NgxAvatarGroupModule } from 'ngx-avatar-group';

@NgModule({
  imports: [
    NgxAvatarGroupModule,
    ....
  ],
  providers: [],
  bootstrap: [AppComponent],
})
  1. import the interface Avatar in the component
import { Avatar } from 'ngx-avatar-group';
  1. Define the needed variables in component file
avatarList1: Avatar[] = [
    {
      id: '1',
      src: 'assets/profile-1.jpeg',
      alt: 'A',
      bgColor: '#fff453',
    },
    {
      id: '2',
      src: 'assets/profile-2.jpeg',
      alt: 'A',
      bgColor: 'green',
    },
    {
      id: '3',
      src: 'assets/profile-3.jpg',
      alt: 'A',
      bgColor: 'purple',
    },
    {
      id: '4',
      src: 'assets/profile-4.jpeg',
      alt: 'A',
      bgColor: 'yellow',
    },
    {
      id: '5',
      src: 'assets/profile-5.jpg',
      alt: 'A',
      bgColor: 'grey',
    },
    {
      id: '6',
      src: 'assets/profile-1.jpeg',
      alt: 'A',
      bgColor: 'pink',
    },

  ];

  space: number = 50;
  max: number = 5;
  size: number = 60;
  textColor: string = 'white';

  onAvatarClick(avatar: any) {
    console.log('avatar clicked', avatar);
  }

  onRemainingAvatarClick(event: any) {
    console.log('Remainig avatar clicked');
  }
  1. Use the ngx-avatar-group component in the html file
<ngx-avatar-group
  [size]="size"
  [space]="space"
  [max]="max"
  [textColor]="textColor"
  [avatarList]="avatarList1"
  (onAvatarClick)="onAvatarClick($event)"
  (onRemainingAvatarClick)="onRemainingAvatarClick($event)"
>

Output

alt text

Using letter avatar

avatarList2: Avatar[] = [
    {
      id: '1',
      letter: 'A',
      bgColor: '#fff453',
    },
    {
      id: '2',
      letter: 'S',
      bgColor: 'green',
    },
    {
      id: '3',
      letter: 'M',
      bgColor: 'purple',
    },
    {
      id: '4',
      letter: 'R',
      bgColor: 'yellow',
    },
    {
      id: '5',
      letter: 'L',
      bgColor: 'grey',
    },
    {
      id: '6',
      letter: 'F',
      bgColor: 'pink',
    },
    ...
    ...
  ];

output

alt text

Using word avatar

avatarList3: Avatar[] = [
    {
      id: '1',
      name: 'Arun Kenjila',
      bgColor: '#8a8a62',
    },
    {
      id: '2',
      name: 'Steve Smith',
      bgColor: '#a07da0',
    },
    {
      id: '3',
      name: 'M N',
      bgColor: '#618d61',
    },
    {
      id: '4',
      name: 'Raj M Thakrey',
      bgColor: 'rgb(151 146 74)',
    },
    {
      id: '5',
      name: 'L ab',
      bgColor: 'grey',
    },
  ];

Output

alt text

Properties

| Name | Descrption | Type | Default value | | :----------------------: | :----------------------------------------------: | :----: | :-----------: | | avatarList | List of image src, letter or words | Avatar | [] | | space | Space between two avatars | number | 50 | | max | Maximum no of avatars to be displayed | number | 5 | | size | Width and Height of avatar | number | 60 | | textColor | Color of text | string | black | | onAvatarClick() | Method executed when any avatar is clicked | method | | | onRemainingAvatarClick() | Method executed when remaining avatar is clicked | method | |