Contenu v1.0.0

Avatar

Représentation d'un utilisateur ou d'une entité avec image, repli sur initiales et indicateur de statut optionnel. Inclut un mode Groupe d'avatars pour empiler plusieurs avatars avec un chevauchement configurable et un indicateur de dépassement « +N autres ». Prend en charge cinq tailles, deux formes, quatre états de statut et des couleurs d'arrière-plan auto-générées de manière déterministe à partir des initiales.

Aperçu et code

Options

Nom Type Par défaut Description
src String Image URL for the avatar
alt String Alt text for the avatar image
initials String Fallback initials displayed when no image is provided (e.g. "JD")
size Symbol :md Avatar size: :xs, :sm, :md, :lg, :xl
status Symbol Online status indicator: :online, :offline, :busy, :away
shape Symbol :circle Avatar shape: :circle or :rounded
href String Optional link URL — wraps the avatar in an anchor tag
color String Background color class for initials (auto-generated from initials if nil)
group Boolean false Whether this avatar is part of a group (adds negative margin and ring)
group_items Array Array of avatar config hashes for group mode rendering
max_display Integer 4 Maximum number of avatars to show before the "+N more" overflow pill

Journal des modifications v1.0.0

- v1.0.0: Initial release with single avatar and avatar group modes
- Five sizes (xs through xl), two shapes (circle, rounded)
- Status indicators (online, offline, busy, away)
- Deterministic initials color generation
- Stimulus-powered expandable overflow in group mode

Obtenir l'accès complet

Débloquez le code source de ce composant et de tous les autres. Paiement unique pour un accès à vie.

Obtenir l'accès maintenant