Avatar

Avatar

An image element with a fallback for representing the user.


user

Installation

npx react-nex add Avatar

Components of Avatar

Avatar Image


user

Avatar Fallback


RN

Examples

Size

There are total 6 sizes in Avatar component as shown below


user
user
user
user
user
user

Custom ClassName

Style as you want using tailwind


user

Props

alt

  • Type: string
  • Description: The alternate text for the avatar image.

className

  • Type: string
  • Description: Additional tailwind classes to apply to the avatar container.

size

  • Type: string
  • Description: The size of the avatar.
    • Values:
      • xs: Extra small
      • sm: Small
      • md: Medium (default)
      • lg: Large
      • xl: Extra large
      • 2xl: Double extra large

src

  • Type: string
  • Description: The URL of the avatar image.