generalcss

Avatar

Image or initials avatar with rounded and bordered variants and a positionable status dot.

CSS Variables

VariableDefaultScopeDescription
--z-avatar-bgvar(--z-bg).z-avatarBackground behind the image or initials.
--z-avatar-bordervar(--z-border).z-avatarBorder color of the bordered variant.
--z-avatar-border-o4%.z-avatarOpacity applied to the bordered variant's border color.
--z-avatar-dot-bgvar(--z-danger).z-avatar-dot-danger::afterBackground color of the status dot; the color variants set it per scheme.
--z-avatar-dot-border · hookvar(--z-bg).z-avatar-dot::after, .z-avatar-dot-top::after, .z-avatar-dot-top-right::after, .z-avatar-dot-right::after, .z-avatar-dot-bottom::after, .z-avatar-dot-bottom-right::after, .z-avatar-dot-bottom-left::after, .z-avatar-dot-left::after, .z-avatar-dot-top-left::afterRing color around the status dot.
--z-avatar-dot-size · hook0.875rem.z-avatar-dot::after, .z-avatar-dot-top::after, .z-avatar-dot-top-right::after, .z-avatar-dot-right::after, .z-avatar-dot-bottom::after, .z-avatar-dot-bottom-right::after, .z-avatar-dot-bottom-left::after, .z-avatar-dot-left::after, .z-avatar-dot-top-left::afterWidth and height of the status dot.
--z-avatar-radiusvar(--z-global-radius).z-avatarCorner radius of the avatar container.
--z-avatar-size2.5rem.z-avatarWidth and height of the avatar.

CSS Classes

ClassRoleApplies toDescription
.z-avatarroot.z-avatarSquare avatar container for an image or initials.
.z-avatar-borderedmodifier.z-avatarAdds a border ring with inner padding around the avatar.
.z-avatar-dotmodifier.z-avatarStatus dot at the bottom-right corner (the default position).
.z-avatar-dot-bottommodifier.z-avatarStatus dot centered on the bottom edge.
.z-avatar-dot-bottom-leftmodifier.z-avatarStatus dot at the bottom-left corner.
.z-avatar-dot-bottom-rightmodifier.z-avatarStatus dot at the bottom-right corner.
.z-avatar-dot-dangermodifier.z-avatarDanger-colored status dot.
.z-avatar-dot-infomodifier.z-avatarInfo-colored status dot.
.z-avatar-dot-leftmodifier.z-avatarStatus dot centered on the left edge.
.z-avatar-dot-mutedmodifier.z-avatarMuted-colored status dot.
.z-avatar-dot-rightmodifier.z-avatarStatus dot centered on the right edge.
.z-avatar-dot-successmodifier.z-avatarSuccess-colored status dot.
.z-avatar-dot-topmodifier.z-avatarStatus dot centered on the top edge.
.z-avatar-dot-top-leftmodifier.z-avatarStatus dot at the top-left corner.
.z-avatar-dot-top-rightmodifier.z-avatarStatus dot at the top-right corner.
.z-avatar-dot-warningmodifier.z-avatarWarning-colored status dot.
.z-avatar-roundedmodifier.z-avatarFully circular avatar and content.
.z-avatar-textelement.z-avatarInitials or text content filling the avatar.