Componente Avatar para Angular | ng-hub-ui-avatar

Componente avatar para Angular con iniciales, imágenes fallback, badges de presencia y variables CSS para interfaces reutilizables de identidad de usuario.

Referencia API

Inputs

size

Tipo: string | number

Por defecto: 50

Avatar size in pixels

name

Tipo: string

User name for generating initials when image sources fail

src

Tipo: string | SafeUrl

Primary custom image source URL for the avatar

alt

Tipo: string

Alternative text for the avatar image for accessibility

round

Tipo: boolean

Por defecto: true

Whether the avatar should be circular (true) or follow cornerRadius

bgColor

Tipo: string

Background color for text avatars. Auto-generated if not provided

fgColor

Tipo: string

Por defecto: #FFF

Text color for initials in text avatars

borderColor

Tipo: string

Border color around the avatar

cornerRadius

Tipo: string | number

Por defecto: 0

Corner radius when round is false

textSizeRatio

Tipo: number

Por defecto: 3

Ratio to calculate text size from avatar size (size / textSizeRatio)

initialsSize

Tipo: string | number

Por defecto: 0

Restricts the number of initials displayed (0 = no restriction)

facebookId

Tipo: string

Facebook user ID for profile picture (best-effort, API restrictions may apply)

githubId

Tipo: string

GitHub username for fetching profile picture

gravatarId

Tipo: string

Gravatar email or MD5 hash for fetching profile picture

value

Tipo: string

Display a custom value as avatar (e.g., "75%", "+5")

style

Tipo: Partial<CSSStyleDeclaration>

Custom styles to apply to the avatar root element

referrerpolicy

Tipo: string

Referrer policy for the avatar image (e.g., "no-referrer")

Outputs

clickOnAvatar

Tipo: Source

Emitted when avatar is clicked, returns the current active source object

Templates

Todavía no hay templates documentados.

Variables CSS

Size & Layout

Control avatar dimensions and spacing

--hub-avatar-size

Tipo: length

Por defecto:50px

Default avatar size when no size is specified

Ejemplos:
24px40px64px96px
--hub-avatar-border-radius

Tipo: length

Por defecto:50%

Border radius for avatar container

Ejemplos:
04px8px50%

Colors & Appearance

Customize avatar colors and visual appearance

--hub-avatar-bg-color

Tipo: color

Por defecto:auto-generated

Background color for text avatars

Ejemplos:
#007bff#28a745#dc3545#6f42c1
--hub-avatar-text-color

Tipo: color

Por defecto:#ffffff

Text color for initials in text avatars

Ejemplos:
#000000#ffffff#6c757d
--hub-avatar-border-color

Tipo: color

Por defecto:transparent

Border color around avatar

Ejemplos:
#dee2e6#007bff#28a745
--hub-avatar-border-width

Tipo: length

Por defecto:0

Border width around avatar

Ejemplos:
1px2px3px

Typography

Control text appearance in avatar initials

--hub-avatar-font-family

Tipo: string

Por defecto:Helvetica, Arial, sans-serif

Font family for avatar initials

Ejemplos:
Inter, sans-serifRoboto, sans-serifsystem-ui
--hub-avatar-font-weight

Tipo: string

Por defecto:normal

Font weight for avatar initials

Ejemplos:
400500600bold
--hub-avatar-text-transform

Tipo: string

Por defecto:uppercase

Text transformation for initials

Ejemplos:
noneuppercaselowercasecapitalize

Estilos y theming

Todavía no hay ejemplos de estilos documentados. Esta sección incluirá recetas de personalización y ejemplos de theming.