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-letters-avatar-14

v14.0.4

Published

Angular package that generates avatar with the initial letters of the provided name

Downloads

10

Readme

This fork support for Angular 14

npm i ngx-letters-avatar-14

Angular letters-avatar Component Ngx-letters-avatar (Angular 2+)

Component will genrate an avatar of your name's initial letters

Features

  • Set width and height properties or only one of them.
  • Set the avatarName property wich is used to display the initials.
  • Set the src property to show ordinary image in case you don't want to show letters avatar.
  • You can set the fontFamily for the characters.
  • You can set circular which is a boolean value to true or false to create a circlular shaped image.
  • You can set borderRadius property to make rounded border for the shape.
  • You can set id property for the image.

Getting Started

Installing

npm i ngx-letters-avatar

Configuration

Ensure you import the module and the dependencies:

import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { LettersAvatarModule } from "ngx-letters-avatar";

@NgModule({
  declarations: [],
  imports: [BrowserModule, LettersAvatarModule],
  exports: [],
  providers: []
})
export class AppModule {}

Basic Usage

<div *ngFor="let user of users">
  <p>{{ user.name }}</p>
  <ngx-letters-avatar 
    [avatarName]="user.name" 
    [width]="40" 
    [circular]="true"
    fontFamily="Open Sans"></ngx-letters-avatar>
</div>
@Component({
  selector: 'app',
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.css"],
});

export class App {
  users = [
    { name: "Girgis A.Jacoub", id: 1 },
    { name: "Your name", id: 2 },
    { name: "another name", id: 3 },
  ];
}

Api for letters-avatar Component

These are the list of Inputs[] that are supported by the component. Configure the settings to meet your requirement.

| Input |Type | Description | Default Value | |:--- |:--- |:--- |:--- | | width | number | Will be used as the width of the image. if provided, you don't need to provide the height property as the height will be the same. only set height and width in case you want to set differnt width and height values. | 60 | | height | number | Will be used as the height of the image. if provided, you don't need to provide the width property. | none | | avatarName | string | The name which the initial letters are taken from. | none | | src | string | The src of the image. provide it in case you want to show image instead of letters avatar. | none | | className | string | To provide a class or classes for the image tag. | none | | fontFamily | string | To provide a font fanily for the characters. | Arial | | circular | boolean | to make a circular shaped img. | false | | borderRadius | number | to make a rounded bordered shape image. | none | | id | string | to provide id attribute for the image tag. | none |