ReactJS Evergreen Avatar Component Last Updated : 05 Jun, 2021 Comments Improve Suggest changes Like Article Like Report React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Avatar components are used to represent users only. We can use the following approach in ReactJS to use the Evergreen Avatar Component. Avatar Props: className: It is used to pass the class name for this component.src: It is used to pass the address of the image for an image element or avatar.size: It is used to indicate the size of the avatar.name: It is used to denote the name used for the initials and title attribute.hashValue: It is used to denote the value used for the hash function.color: It is used to denote the color used for the avatar.getInitials: It is a function that is used to get the initials based on the name.forceShowInitials: It is used to force show the initials when this is set to true.sizeLimitOneCharacter: It is used to use a single initial for the avatar when the size is smaller than this number.shape: It is used to denote the shape of the avatar component. It can be round or square.Creating React Application And Installing Module: Step 1: Create a React application using the following command: npx create-react-app foldername Step 2: After creating your project folder i.e. foldername, move to it using the following command: cd foldername Step 3: After creating the ReactJS application, Install the required module using the following command: npm install evergreen-ui Project Structure: It will look like the following. Project StructureExample: Now write down the following code in the App.js file. Here, App is our default component where we have written our code. App.js import React from 'react' import { Avatar } from 'evergreen-ui' export default function App() { return ( <div style={{ display: 'block', width: 700, paddingLeft: 30 }}> <h4>ReactJS Evergreen Avatar Component</h4> <Avatar name="Ajay" size={50} /> <Avatar name="Bunty" size={50} /> <Avatar name="Chirag" size={50} /> <Avatar name="Dinesh" size={50} /> </div> ); } Step to Run Application: Run the application using the following command from the root directory of the project: npm startOutput: Now open your browser and go to http://localhost:3000/, you will see the following output: Reference: https://evergreen.segment.com/components/avatar Comment More infoAdvertise with us Next Article ReactJS Evergreen Avatar Component G gouravhammad Follow Improve Article Tags : JavaScript Web Technologies ReactJS ReactJS-Evergreen Similar Reads ReactJS Evergreen Alert Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Alert Component is used for are urgent interruptions, requiring acknowledgment, that informs the user about a situation. We 2 min read ReactJS Evergreen Button Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Button Component allows the user to take actions, and make choices, with a single tap. We can use the following approach in 3 min read ReactJS Evergreen Tab Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Tab Component allows the user to switch between components present in given different tabs. It is used for organizing our c 2 min read ReactJS Evergreen Menu Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Menu Component allows the user to show a list of actions that the user can take. We can use the following approach in React 3 min read ReactJS Evergreen Autocomplete Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Autocomplete Component is used for auto-completing the free text value with the option value. It basically allows the user 3 min read Like