React Avatar is a pure CSS component used to add initials, icons, or images representing people or objects in different shapes and sizes. The Avatar control can be easily integrated with ListView, Badge, Card, and other container components.
The React Avatar component supports various types of images to represent user profile images like those in applications such as Mail, Outlook, GitHub, and StackOverflow.
Represents a user’s 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 either square or circular 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, and others, 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 React Avatar component with layout components, specifically listview and cards to achieve different applications, such as mobile contact, Mail, Outlook and more. Integrate with badge component to represent a notification count like in mail applications.
Avatar component is also available in Vue, Angular, and JavaScript frameworks. Check out the different Avatar 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.