# Avatar URL: /react/components/avatar Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/components/avatar.mdx A component for displaying a user's profile image. 사용 가능 버전: @seed-design/react@0.0.1, @seed-design/css@0.0.1 ## Preview ```tsx import { Box, Flex } from "@seed-design/react"; import { Avatar, AvatarBadge } from "seed-design/ui/avatar"; import { IdentityPlaceholder } from "seed-design/ui/identity-placeholder"; export default function AvatarPreview() { return ( } > } /> ); } ``` ## Installation - npm: npx @seed-design/cli@latest add ui:avatar - pnpm: pnpm dlx @seed-design/cli@latest add ui:avatar - yarn: yarn dlx @seed-design/cli@latest add ui:avatar - bun: bun x @seed-design/cli@latest add ui:avatar ## Props ### `Avatar` ### `AvatarBadge` ### `AvatarStack` ## Examples ### Size ```tsx import { Flex } from "@seed-design/react"; import { Avatar } from "seed-design/ui/avatar"; export default function AvatarSize() { return ( ); } ``` ### Badge & Badge Mask ```tsx import { IdentityPlaceholder } from "seed-design/ui/identity-placeholder"; import { Avatar, AvatarBadge } from "seed-design/ui/avatar"; import { Box, HStack } from "@seed-design/react"; export default function () { return ( } > } > 뱃지를 설명하는 대체 텍스트를 제공해야 합니다. } > 뱃지를 설명하는 대체 텍스트를 제공해야 합니다. ); } ``` ### Stack ```tsx import { Avatar, AvatarStack } from "seed-design/ui/avatar"; import { IdentityPlaceholder } from "seed-design/ui/identity-placeholder"; export default function AvatarStackExample() { return ( } /> } /> } /> } /> ); } ``` ### Fallback Image You can use the `fallback` prop to specify the element to show when the image fails to load. This is usually [IdentityPlaceholder](/react/components/identity-placeholder). ```tsx import { Flex } from "@seed-design/react"; import { Avatar } from "seed-design/ui/avatar"; import { IdentityPlaceholder } from "seed-design/ui/identity-placeholder"; export default function AvatarFallbackExample() { return ( } /> } /> ); } ```