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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@nis3soft/ng-avatar

v0.0.4

Published

Simple Angular Avatar component for use with Material UI.

Readme

NG Avatar <ng-avatar>

Simple Angular Avatar component for use with Material UI.

NG Avatar

Installation

To install this library, run:

$ npm install @nis3soft/ng-avatar --save

Consuming your library

After instalation import module into your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import your library
import { NgAvatarModule } from '@nis3soft/ng-avatar';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    // Specify NgAvatarModule as an import 
    NgAvatarModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once your library is imported, you can use its components, directives and pipes in your Angular application:

<!-- You can now use ng-avatar component in app.component.html -->
<div fxLayout="column" fxLayoutGap="10px">
  
  <ng-avatar size="48" name="John Doe" color="#2196f3"></ng-avatar>
  
  <ng-avatar text="NT" color="#e91e63"></ng-avatar>
  
  <ng-avatar size="48" photo="https://randomuser.me/api/portraits/women/79.jpg"></ng-avatar>
  
  <ng-avatar status="#4caf50" size="36" photo="https://randomuser.me/api/portraits/men/79.jpg"></ng-avatar>
  
  <ng-avatar-group>
    <ng-avatar size="48" photo="https://randomuser.me/api/portraits/women/7.jpg"></ng-avatar>
    <ng-avatar size="48" photo="https://randomuser.me/api/portraits/women/15.jpg"></ng-avatar>
    <ng-avatar size="48" photo="https://randomuser.me/api/portraits/women/9.jpg"></ng-avatar>
    <ng-avatar size="48" photo="https://randomuser.me/api/portraits/women/13.jpg"></ng-avatar>
    <ng-avatar size="48" photo="https://randomuser.me/api/portraits/women/18.jpg"></ng-avatar>
    <ng-avatar size="48" photo="https://randomuser.me/api/portraits/women/21.jpg"></ng-avatar>
  </ng-avatar-group>
  
  <ng-avatar-group [plus]="5">
    <ng-avatar photo="https://randomuser.me/api/portraits/men/1.jpg"></ng-avatar>
    <ng-avatar photo="https://randomuser.me/api/portraits/men/2.jpg"></ng-avatar>
    <ng-avatar photo="https://randomuser.me/api/portraits/men/3.jpg"></ng-avatar>
    <ng-avatar photo="https://randomuser.me/api/portraits/men/4.jpg"></ng-avatar>
    <ng-avatar photo="https://randomuser.me/api/portraits/men/5.jpg"></ng-avatar>
  </ng-avatar-group>
  
  
  <ng-avatar
  size="32"
  name="Nikola Trifunovic"
  status="#5eba00"
  [matMenuTriggerFor]="changeStatus">
</ng-avatar>
<mat-menu #changeStatus="matMenu">
  <button mat-menu-item disabled>
    <span>Online</span>
  </button>
  <button mat-menu-item>
    <span>Offline</span>
  </button>
</mat-menu>


<ng-avatar
size="32"
photo="https://randomuser.me/api/portraits/men/31.jpg"
name="Stefan Trifunovic"
[matMenuTriggerFor]="userPicker">
</ng-avatar>
<mat-menu #userPicker="matMenu">
  <button mat-menu-item>
    <ng-avatar size="24" name="Nikola Trifunovic" class="m-r-8"></ng-avatar>
    <span>Nikola Trifunovic</span>
  </button>
  <button mat-menu-item disabled>
    <ng-avatar size="24" photo="https://randomuser.me/api/portraits/men/31.jpg" class="m-r-8"></ng-avatar>
    <span>Stefan Trifunovic</span>
  </button>
  <button mat-menu-item>
    <ng-avatar size="24" name="Vasilije Trifunovic" class="m-r-8"></ng-avatar>
    <span>Vasilije Trifunovic</span>
  </button>
</mat-menu>

</div>

Options

| Attribute | Type | Default | Description | | ------------------- | ----------------- | -------- |-----------------------------------------------| | name | string | | Generate avatar usinginitials | text | string | | Generate avatar using text value | photo | string | | Generate avatar using image | size | number | 32 | Size of avatar in pixels | color | string | random | Background color of avatar (hex or name) | status | string | null | Color of status indicator (hex or name)

Options

| Attribute | Type | Default | Description | | ------------------- | ----------------- | -------- |-----------------------------------------------| | plus | number | 0 | Number to be used as value in plus avatar | plusSize | number | 32 | Size of avatar for plus in pixels | color | string | random | Background color of avatar (hex or name)

History

  • 0.0.1 : Initial experimental release
  • 0.0.4 : Removed console.log call, added plusSize option to <ng-avatar-group>

License

MIT © Nikola Trifunovic