generalcss
Avatar
Image or initials avatar with rounded and bordered variants and a positionable status dot.
CSS Variables
| Variable | Default | Scope | Description |
|---|---|---|---|
--z-avatar-bg | var(--z-bg) | .z-avatar | Background behind the image or initials. |
--z-avatar-border | var(--z-border) | .z-avatar | Border color of the bordered variant. |
--z-avatar-border-o | 4% | .z-avatar | Opacity applied to the bordered variant's border color. |
--z-avatar-dot-bg | var(--z-danger) | .z-avatar-dot-danger::after | Background color of the status dot; the color variants set it per scheme. |
--z-avatar-dot-border · hook | var(--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::after | Ring color around the status dot. |
--z-avatar-dot-size · hook | 0.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::after | Width and height of the status dot. |
--z-avatar-radius | var(--z-global-radius) | .z-avatar | Corner radius of the avatar container. |
--z-avatar-size | 2.5rem | .z-avatar | Width and height of the avatar. |
CSS Classes
| Class | Role | Applies to | Description |
|---|---|---|---|
.z-avatar | root | .z-avatar | Square avatar container for an image or initials. |
.z-avatar-bordered | modifier | .z-avatar | Adds a border ring with inner padding around the avatar. |
.z-avatar-dot | modifier | .z-avatar | Status dot at the bottom-right corner (the default position). |
.z-avatar-dot-bottom | modifier | .z-avatar | Status dot centered on the bottom edge. |
.z-avatar-dot-bottom-left | modifier | .z-avatar | Status dot at the bottom-left corner. |
.z-avatar-dot-bottom-right | modifier | .z-avatar | Status dot at the bottom-right corner. |
.z-avatar-dot-danger | modifier | .z-avatar | Danger-colored status dot. |
.z-avatar-dot-info | modifier | .z-avatar | Info-colored status dot. |
.z-avatar-dot-left | modifier | .z-avatar | Status dot centered on the left edge. |
.z-avatar-dot-muted | modifier | .z-avatar | Muted-colored status dot. |
.z-avatar-dot-right | modifier | .z-avatar | Status dot centered on the right edge. |
.z-avatar-dot-success | modifier | .z-avatar | Success-colored status dot. |
.z-avatar-dot-top | modifier | .z-avatar | Status dot centered on the top edge. |
.z-avatar-dot-top-left | modifier | .z-avatar | Status dot at the top-left corner. |
.z-avatar-dot-top-right | modifier | .z-avatar | Status dot at the top-right corner. |
.z-avatar-dot-warning | modifier | .z-avatar | Warning-colored status dot. |
.z-avatar-rounded | modifier | .z-avatar | Fully circular avatar and content. |
.z-avatar-text | element | .z-avatar | Initials or text content filling the avatar. |