MiComponents/Documentation

Avatar

A component that displays a user's profile image or initials.

Installation

npx micomponents-cli add avatar

Preview

CN

Usage

Import

import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";

Basic Usage

<Avatar variant="primary" size="md" shape="circle">
  <AvatarImage src="https://github.com/shadcn.png" />
  <AvatarFallback>CN</AvatarFallback>
</Avatar>

Variants

Avatar comes with multiple color variants for different contexts.
PRISECTERQUA

Sizes

Choose from multiple sizes to fit your UI.
XSSMMLGXL

Shapes

Avatars can be displayed as circles or squares.
CRSQ

API Reference

PropTypeDefaultDescription
variantprimary | secondary | tertiary | quaternaryprimaryThe color variant of the avatar
sizemicro | xs | sm | md | lg | xlmdThe size of the avatar
shapecircle | squaresquareThe shape of the avatar