Components
Avatar

Avatar

The Avatar component provides you with user avatars and profile pictures.

Import

import { Avatar, AvatarImage, AvatarFallback } from '@nostromo/ui-core'
// or
import { Avatar, AvatarImage, AvatarFallback } from '@nostromo/ui-core/avatar'

Usage

import { Avatar, AvatarImage, AvatarFallback } from '@nostromo/ui-core'
 
export default function Example() {
  return (
    <Avatar>
      <AvatarImage src="/avatar.jpg" alt="User" />
      <AvatarFallback>JD</AvatarFallback>
    </Avatar>
  )
}

Live Examples

Live Example
☀️
Copy
Storybook →
View Code
import { Avatar, AvatarFallback, AvatarImage } from '@nostromo/ui-core' export default function AvatarExamples() { return ( <div className="space-x-4"> <Avatar> <AvatarImage src="https://via.placeholder.com/40?text=JD" alt="User" /> <AvatarFallback>JD</AvatarFallback> </Avatar> ...

Sizes

Live Example
☀️
Copy
Storybook →
View Code
import { Avatar, AvatarFallback } from '@nostromo/ui-core' export default function AvatarSizes() { return ( <div className="space-x-4"> <Avatar size="sm"> <AvatarFallback>SM</AvatarFallback> </Avatar> <Avatar size="default"> <AvatarFallback>MD</AvatarFallback>...

Props

Avatar

PropTypeDefaultRequiredDescription
size"sm" | "default" | "lg""default"NoSize of the avatar
variant"default" | "rounded" | "square""default"NoShape variant
srcstringundefinedNoImage source URL
altstringundefinedNoAlt text for the image
fallbackstringundefinedNoFallback text when image fails to load
classNamestringundefinedNoAdditional CSS classes
childrenReact.ReactNodeundefinedNoAvatar content (AvatarImage, AvatarFallback)

AvatarImage

PropTypeDefaultRequiredDescription
srcstring-YesImage source URL
altstringundefinedNoAlt text for the image
classNamestringundefinedNoAdditional CSS classes

AvatarFallback

PropTypeDefaultRequiredDescription
classNamestringundefinedNoAdditional CSS classes
childrenReact.ReactNodeundefinedNoFallback content (usually initials)