Tailwind CSS Avatar - React
Use our Tailwind CSS Avatar
component to portray people or objects in your web projects. The Avatar
can be used as a visual identifier for a user profile on your website.
See below our beautiful Avatar
example that you can use in your Tailwind CSS and React project. The example also comes in different styles and colors so you can adapt it easily to your needs.
Avatar Variants
The Avatar
component comes with 3 different variants that you can change it using the variant
prop.
Avatar Sizes
The Avatar
component comes with 6 different sizes that you can change it using the size
prop.
Avatar with border
You can add border around the avatar using the withBorder
prop. To change the color of the avatar border use the color
prop, by default it's blue
.
Avatar with Text
You can use avatar with other components as well, see example below.
import { Avatar, Typography } from "@material-tailwind/react";
export default function Example() {
return (
<div className="flex flex-col gap-6">
<div className="flex items-center gap-4">
<Avatar src="/img/face-2.jpg" alt="avatar" />
<div>
<Typography variant="h6">Candice Wu</Typography>
<Typography variant="small" color="gray" className="font-normal">Web Developer</Typography>
</div>
</div>
<div className="flex items-center gap-4">
<Avatar src="/img/face-2.jpg" alt="avatar" variant="rounded" />
<div>
<Typography variant="h6">Candice Wu</Typography>
<Typography variant="small" color="gray" className="font-normal">Web Developer</Typography>
</div>
</div>
<div className="flex items-center gap-4">
<Avatar src="/img/face-2.jpg" alt="avatar" variant="square" />
<div>
<Typography variant="h6">Candice Wu</Typography>
<Typography variant="small" color="gray" className="font-normal">Web Developer</Typography>
</div>
</div>
</div>
);
}
Avatar Stack
Edit this page on Github