![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ng-hub-ui-avatar
Advanced tools
A powerful, flexible, and standalone Angular avatar component that generates and fetches user avatars from multiple sources including social media, Gravatar, or custom images with intelligent fallback system
This component is part of the ng-hub-ui ecosystem, which includes:
This library is a fork of ngx-avatars, originally created by HaithemMosbahi and maintained by Tiago Casinhas.
The original work provided an excellent foundation for avatar management in Angular applications. This fork was created to:
All credit for the original implementation goes to the original authors and contributors of ngx-avatars.
A versatile avatar component for Angular applications that fetches or generates avatars based on user information. The component includes a sophisticated fallback system that attempts different sources if the primary source fails.
You can use this component with either a single source or multiple avatar sources, with the fallback system automatically selecting the first valid avatar.
Additionally, the component can display name initials or custom values as avatars.
Supported avatar sources:
The fallback system follows the same order as the source list above, with Facebook having the highest priority.
Install the avatar component using npm:
npm install ng-hub-ui-avatar --save
Or using yarn:
yarn add ng-hub-ui-avatar
As this is a standalone component, you don't need to import any module. Just import the component directly in your standalone components or pages:
import { Component } from '@angular/core';
import { NgHubUiAvatar } from 'ng-hub-ui-avatar';
@Component({
selector: 'app-my-component',
standalone: true,
imports: [NgHubUiAvatar],
template: `
<ng-hub-ui-avatar></ng-hub-ui-avatar>
`
})
export class MyComponent { }
If you're using NgModule (legacy approach), you can import it in your components array:
import { NgModule } from '@angular/core';
import { NgHubUiAvatar } from 'ng-hub-ui-avatar';
@NgModule({
imports: [
// other imports...
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
Use it in your components:
<ng-hub-ui-avatar></ng-hub-ui-avatar>
<ng-hub-ui-avatar facebookId="1508319875"></ng-hub-ui-avatar>
<ng-hub-ui-avatar googleId="1508319875"></ng-hub-ui-avatar>
<ng-hub-ui-avatar twitterId="1508319875"></ng-hub-ui-avatar>
<ng-hub-ui-avatar instagramId="dccomics" size="70"></ng-hub-ui-avatar>
<ng-hub-ui-avatar name="John Doe"></ng-hub-ui-avatar>
<ng-hub-ui-avatar value="75%"></ng-hub-ui-avatar>
<!-- Multiple sources with fallback -->
<ng-hub-ui-avatar
facebookId="userFacebookID"
skypeId="userSkypeID"
googleId="google"
name="John Doe"
src="assets/avatar.jpg"
value="28%"
size="100"
[round]="true">
</ng-hub-ui-avatar>
Attribute | Type | Default | Description |
---|---|---|---|
facebookId | string | null | Facebook ID |
googleId | string | null | Google ID |
twitterId | string | null | Twitter Handle |
instagramId | string | null | Instagram Handle |
vkontakteId | string | null | VK ID |
skypeId | string | null | Skype ID |
githubId | string | null | Github ID |
src | string | null | Fallback image to use |
name | string | null | Will be used to generate avatar based on initials |
value | string | null | Show a value as avatar |
initialsSize | number | 0 | Limits the number of characters in initials (0 = no limit) |
bgColor | string | random | Background color (hex format, e.g., #FF0000) |
fgColor | string | #FFF | Text color (hex format, e.g., #FF0000) |
size | number | 50 | Size of the avatar |
textSizeRatio | number | 3 | Text size as a fraction of avatar size |
round | boolean | true | Round the avatar corners |
cornerRadius | number | 0 | Border radius for square avatars |
borderColor | string | undefined | Border color |
style | object | Custom styles for root element | |
clickOnAvatar | Output | Event emitted on avatar click | |
referrerpolicy | string | null | Referrer policy for image requests |
If you find this library helpful, consider supporting its development:
Contributions are welcome! Here's how you can help:
git checkout -b feature/my-new-feature
git commit -am 'Add some feature'
git push origin feature/my-new-feature
MIT © Carlos Morcillo
FAQs
A powerful, flexible, and standalone Angular avatar component that generates and fetches user avatars from multiple sources including social media, Gravatar, or custom images with intelligent fallback system
The npm package ng-hub-ui-avatar receives a total of 20 weekly downloads. As such, ng-hub-ui-avatar popularity was classified as not popular.
We found that ng-hub-ui-avatar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.