# Avatar Avatar is a visual representation of a user, business, or entity. It provide quick visual identification in headers, comments, chat messages, and user profiles. **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-avatar--introduction ## Variants documented in Storybook - BaseAvatar: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-avatar--baseavatar - StatusAvatar: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-avatar--statusavatar - AvatarGroup: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-avatar--avatargroup - ProfileAvatar: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-avatar--profileavatar ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Avatar. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Avatar Group — Group Variants HTML: ```html
Avatar is a visual representation of a user, business, or entity. It provide quick visual identification in headers, comments, chat messages, and user profiles.
Visual demonstration of the four primary avatar configurations supported by the design system.
|
3-Extra Large
ux4g-avatar-3xl
|
|
2-Extra Large
ux4g-avatar-2xl
|
|
Extra Large
ux4g-avatar-xl
|
|
Large
ux4g-avatar-l
|
|
Medium [Default]
ux4g-avatar-m
|
|
Small
ux4g-avatar-s
|
|
Extra Small
ux4g-avatar-xs
|
|
Large
ux4g-badge-l
|
|
Medium [Default]
ux4g-badge-m
|
|
Small
ux4g-badge-s
|
|
3-Extra Large
ux4g-badge-profile-3xl
|
|
2-Extra Large
ux4g-badge-profile-2xl
|
|
Extra Large
ux4g-badge-profile-xl
|
|
Large [Default]
ux4g-badge-profile-l
|
|
Online Status
ux4g-badge-dot-success
|
|
Offline Status
ux4g-badge-dot-neutral
|
|
Busy / Busy Icon
ux4g-badge-icon-warning
|
|
Success Icon
ux4g-badge-icon-success
|
|
Error Icon
ux4g-badge-icon-danger
|
|
Profile Verify Icon
ux4g-badge-icon-primary
|
Avatar is a visual representation of a user, business, or entity. It provide quick visual identification in headers, comments, chat messages, and user profiles.
Visual demonstration of the four primary avatar configurations supported by the design system.
|
3-Extra Large
ux4g-avatar-3xl
|
|
2-Extra Large
ux4g-avatar-2xl
|
|
Extra Large
ux4g-avatar-xl
|
|
Large
ux4g-avatar-l
|
|
Medium [Default]
ux4g-avatar-m
|
|
Small
ux4g-avatar-s
|
|
Extra Small
ux4g-avatar-xs
|
|
Large
ux4g-badge-l
|
|
Medium [Default]
ux4g-badge-m
|
|
Small
ux4g-badge-s
|
|
3-Extra Large
ux4g-badge-profile-3xl
|
|
2-Extra Large
ux4g-badge-profile-2xl
|
|
Extra Large
ux4g-badge-profile-xl
|
|
Large [Default]
ux4g-badge-profile-l
|
|
Online Status
ux4g-badge-dot-success
|
|
Offline Status
ux4g-badge-dot-neutral
|
|
Busy / Busy Icon
ux4g-badge-icon-warning
|
|
Success Icon
ux4g-badge-icon-success
|
|
Error Icon
ux4g-badge-icon-danger
|
|
Profile Verify Icon
ux4g-badge-icon-primary
|
Avatar is a visual representation of a user, business, or entity. It provide quick visual identification in headers, comments, chat messages, and user profiles.
Visual demonstration of the four primary avatar configurations supported by the design system.
|
3-Extra Large
ux4g-avatar-3xl
|
|
2-Extra Large
ux4g-avatar-2xl
|
|
Extra Large
ux4g-avatar-xl
|
|
Large
ux4g-avatar-l
|
|
Medium [Default]
ux4g-avatar-m
|
|
Small
ux4g-avatar-s
|
|
Extra Small
ux4g-avatar-xs
|
|
Large
ux4g-badge-l
|
|
Medium [Default]
ux4g-badge-m
|
|
Small
ux4g-badge-s
|
|
3-Extra Large
ux4g-badge-profile-3xl
|
|
2-Extra Large
ux4g-badge-profile-2xl
|
|
Extra Large
ux4g-badge-profile-xl
|
|
Large [Default]
ux4g-badge-profile-l
|
|
Online Status
ux4g-badge-dot-success
|
|
Offline Status
ux4g-badge-dot-neutral
|
|
Busy / Busy Icon
ux4g-badge-icon-warning
|
|
Success Icon
ux4g-badge-icon-success
|
|
Error Icon
ux4g-badge-icon-danger
|
|
Profile Verify Icon
ux4g-badge-icon-primary
|