Superui logo

SuperUI

alpha

DocsCommunityMy components
DocsCommunityMy components

Avatar

Reusable avatar component for React.

import { Avatar } from "@superui/styles";

Simple Avatar

Superui Avatar
Superui Avatar
import { Avatar } from "@superui/styles";

<Avatar
  src="https://avatars0.githubusercontent.com/u/22749943?s=460&v=4"
  alt="Superui Avatar"
  size="md"
  type="square"
  bordered
/>;

Props Avatar

NameTypeDefaultDescription
srcString-Source of the image
altString-Alt text for the image
typeStringcircleSquare or circle
sizeStringsmSize of the image
borderedBooleanfalseWhether the image is bordered or not
classNameString-Custom class names

Avatar Group

import { AvatarGroup } from "@superui/styles";

<AvatarGroup
  max={4}
  data={Array.from(Array(10).keys()).map((i) => ({
    name: `${i}`,
    alt: `${i}`,
    src: `https://source.boringavatars.com/beam/120/${i}?colors=264653,2a9d8f,e9c46a,f4a261,e76f51`,
  }))}
  size="md"
/>;

Props AvatarGroup

NameTypeDefaultDescription
sizeStringsmSize of the image
maxNumber-Maximum number of avatars to display
keyString-Key for the image (Group)
dataArray-Array of data for the group (name, alt, src)