Avatar

free

Avatar gives people, teams, and objects a compact visual identity across dense UI.

Alice Smith
Alice Smith
@alicesmith
import Avatar from '@/components/ui/avatar';

export default function UsageDemo() {
  return (

Installation

Add this component with the NateUI CLI.

npx nateui@latest add Avatar

Examples

Types

NUMaya Chen
import { PiUser } from 'react-icons/pi'
import Avatar from '@/components/ui/avatar';

export default function TypesDemo() {

Sizes

import { PiUser } from 'react-icons/pi'
import Avatar from '@/components/ui/avatar';

export default function SizeDemo() {

Shapes

Square avatarRounded avatarCircle avatar
import Avatar from '@/components/ui/avatar';

export default function ShapeDemo() {
  return (

Colors

NUJSPMQA
import Avatar from '@/components/ui/avatar';

const colors = [
  {

Status

Ivy TanLiam WongNora Lee
import Avatar from '@/components/ui/avatar';
import Badge from '@/components/ui/badge';

const users = [

Group

Ava ChenDaniel KimMira PatelOmar Ali+2
import Avatar from '@/components/ui/avatar';

const members = [
  {

API

Avatar accepts the props below plus native props for the root span.

Avatar

PropDescriptionTypeDefault
altAlternate text passed to the rendered image when src is set.string-
childrenText fallback shown when neither src nor icon is provided.ReactNode-
classNameClass names applied to the root avatar.string-
iconIcon content shown when no image source is provided.ReactNode-
onClickClick handler for interactive avatar usage.() => void-
refRef forwarded to the root span.Ref<HTMLSpanElement>-
shapeAvatar corner treatment.AvatarShape'circle'
sizePreset size or numeric pixel size.AvatarSize'md'
srcImage URL rendered inside the avatar.string-
srcSetResponsive image source set passed to the rendered image.string-
...nativeSpanPropsNative props for the root span.NativeAvatarSpanProps-

Avatar.Group

PropDescriptionTypeDefault
chainedOverlaps child avatars into a chained stack.booleanfalse
childrenAvatar elements rendered in the group.ReactNode-
classNameClass names applied to the group wrapper.string-
maxCountMaximum number of child avatars to show before rendering the overflow avatar.number4
omittedAvatarContentCustom content for the overflow avatar.string | ReactNode'+N'
omittedAvatarPropsAvatar props applied to the generated overflow avatar.Avatar props object-
omittedAvatarTooltipWraps the overflow avatar in a tooltip.booleanfalse
omittedAvatarTooltipPropsTooltip props applied to the overflow tooltip, excluding title.AvatarTooltipProps-
onOmittedAvatarClickClick handler for the overflow avatar.() => void-
...nativeDivPropsNative props for the group wrapper div.NativeAvatarGroupDivProps-

Types

type AvatarShape = 'round' | 'circle' | 'square';
type AvatarSize = 'sm' | 'md' | 'lg' | number;
type NativeAvatarSpanProps = ComponentProps<'span'>;
type AvatarTooltipProps = Omit<TooltipProps, 'title'>;
type NativeAvatarGroupDivProps = ComponentProps<'div'>;