React Avatar is a pure CSS component used to add initials, icons, or images representing people or objects in different shapes and sizes. It can be easily integrated with ListView, Badge, Card, and other container components.
The React Avatar component supports various types of images to represent users profiles like those in applications such as Gmail, Outlook, GitHub, and StackOverflow.
Represent users’ initials in different sizes.
Create word or text avatars from user names.
The avatar supports well-known media types, icons, SVG, font icons, and text.
The React Avatar component can be square or circular and in one of five sizes: extra small, small, medium, large, and extra large. By default, avatars are created in a square shape with a medium size.
Completely customize the avatar attributes, like dimensions and colors.
In applications like Gmail, StackOverflow, GitHub, user avatars are represented using Identicons, which are visual representations of hash values of IP addresses.
Use the Syncfusion React Avatar and Badge components to integrate dynamically generated Identicons by following the instructions in this blog:
Easily integrate the React Avatar component with layout controls, specifically ListView and Card, to achieve different applications, such as a mobile contact list or Outlook-like appearance. Integrate it with the Badge component to show a notification count like in email applications.
The Avatar control is also available in Vue, Angular, and JavaScript frameworks. Check out the Avatar different platforms from the links below:
Easily get started with the React Avatar using a few simple lines of TSX code example as demonstrated below. Also explore our React Avatar example that shows you how to render and configure a Avatar in React.
import * as ReactDOM from 'react-dom';
import * as React from 'react';
import { SampleBase } from '../common/sample-base';
import './default.css';
// tslint:disable:max-line-length
// * Sample for CSS avatar component
export class Default extends SampleBase<{}, {}> {
render() {
return (
<div className='control-pane'>
<div className="sample_container avatar-default">
<div className="avatar-block">
<div className="e-card e-avatar-showcase">
<div className="e-card-content">
{/* <!-- xSmall Avatar--> */}
<div className="e-avatar e-avatar-xsmall image"></div>
{/* <!-- Small Avatar--> */}
<div className="e-avatar e-avatar-small image"></div>
{/* <!-- Avatar--> */}
<div className="e-avatar image"></div>
{/* <!-- Large Avatar--> */}
<div className="e-avatar e-avatar-large image"></div>
{/* <!-- xLarge Avatar--> */}
<div className="e-avatar e-avatar-xlarge image"></div>
</div>
<div className="e-card-content">
<div>Default</div>
</div>
</div>
</div>
</div>
</div>
);
}
}
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.