Traken UI

Avatar

Displays user profile images, icons, or fallback content with customizable size, color, borders, and styling for flexible profile representation.


Variants

Avatar Group


Avatar Types

Defualt Avatar
Image Avatar
Name Avatar

Colors

Base Color
Ghost Color
Primary Color
Secondary Color
Success Color
Warning Color
Danger Color

Sizes

Small Avatar
Defualt Avatar
Medium Avatar
Large Avatar
XL Avatar

Radius

Default Radius
Small Radius
Medium Radius
Large Radius
XL Radius
2XL Radius
3XL Radius
Full Radius

Features

  • Supports profile images, icons, and custom fallback content
  • Configurable sizes, border radius, and color themes
  • Optional border animation for interactive effects
  • Handles image loading states with fallback and showFallback support
  • Allows custom image components and props for advanced control
  • Accessible and optionally focusable

Props

PropTypeDefaultDescription
srcstringSource URL of the avatar image.
altstringAlternative text for the avatar image.
isBorderedbooleantrueWhether to show a border around the avatar.
color"base" | "ghost" | "primary" | "secondary" | "success" | "warning" | "danger""base"Color theme of the avatar.
size"sm" | "base" | "md" | "lg" | "xl""base"Size of the avatar.
radius"sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "default""full"Border radius of the avatar.
namestringName used for initials fallback or accessibility.
iconReactNodeCustom icon to display inside the avatar.
fallbackReactNodeContent to display when the image fails to load or is not provided.
isDisabledbooleanfalseWhether the avatar is disabled (non-interactive).
isFocusablebooleantrueWhether the avatar is focusable.
showFallbackbooleanfalseForce show the fallback content instead of the image.
imgComponentReactNodeCustom image component for advanced usage.
imgPropsReact.ImgHTMLAttributes<HTMLImageElement>Additional props for the img element.
isBorderAnimationboolean

On this page