Featuring Design System
Legacy

CoreAvatar

아바타 컴포넌트

Usage

텍스트 아바타

import { CoreAvatar } from '@featuring-corp/components';

// 기본 (원형)
<CoreAvatar text="F" />

// 정사각형
<CoreAvatar shape="square" text="F" />

// 색상 지정
<CoreAvatar text="F" colorType="red" />
<CoreAvatar text="Featuring" colorType="blue" />

이미지 아바타

import { CoreAvatar } from '@featuring-corp/components';

<CoreAvatar 
  src="https://example.com/image.jpg" 
  isLazy 
/>

// 이미지 로드 실패 시 텍스트 표시
<CoreAvatar 
  text="에러" 
  src="https://error-image" 
  isLazy 
/>

기본 아이콘 표시

import { CoreAvatar } from '@featuring-corp/components';

<CoreAvatar showDefaultIcon />
<CoreAvatar shape="square" showDefaultIcon />

Dot 표시

import { CoreAvatar } from '@featuring-corp/components';

// Filled dot
<CoreAvatar 
  text="F" 
  dot={{ color: 'red', type: 'filled' }} 
/>

// Border dot
<CoreAvatar 
  text="F" 
  dot={{ color: 'red', type: 'border', size: 'sm' }} 
/>

// 이미지와 함께
<CoreAvatar 
  src="https://example.com/image.jpg" 
  dot={{ color: 'red' }} 
  isLazy 
/>

Status Badge

import { CoreAvatar } from '@featuring-corp/components';

<CoreAvatar 
  text="F" 
  statusBadge={{ 
    status: 'primary', 
    type: 'filled', 
    text: '99+' 
  }} 
/>

<CoreAvatar 
  src="https://example.com/image.jpg" 
  statusBadge={{ 
    status: 'success', 
    type: 'filled', 
    text: '99+' 
  }} 
  isLazy 
/>

Icon Badge

import { CoreAvatar } from '@featuring-corp/components';
import { IconInstagramColored, IconYoutubeColored } from '@featuring-corp/icons';

<CoreAvatar 
  text="F" 
  iconBadge={{ icon: <IconInstagramColored /> }} 
/>

<CoreAvatar 
  src="https://example.com/image.jpg" 
  iconBadge={{ icon: <IconYoutubeColored /> }} 
  isLazy 
/>

Border와 함께 사용

import { CoreAvatar } from '@featuring-corp/components';

<CoreAvatar 
  text="F" 
  colorType="green" 
  border 
/>

<CoreAvatar 
  text="F" 
  colorType="green" 
  border 
  dot={{ color: 'red' }} 
/>

크기 설정

import { CoreAvatar } from '@featuring-corp/components';

<CoreAvatar text="F" size="xs" />
<CoreAvatar text="F" size="sm" />
<CoreAvatar text="F" size="md" />
<CoreAvatar text="F" size="lg" />
<CoreAvatar text="F" size="xl" />

모든 기능 조합

import { CoreAvatar } from '@featuring-corp/components';
import { IconInstagramColored } from '@featuring-corp/icons';

<CoreAvatar 
  shape="circle"
  size="lg"
  src="https://example.com/image.jpg"
  text="Fallback"
  colorType="blue"
  border
  dot={{ color: 'red', type: 'filled' }}
  statusBadge={{ status: 'primary', type: 'filled', text: '99+' }}
  iconBadge={{ icon: <IconInstagramColored /> }}
  isLazy
/>

Props

Prop

Type

avatarShape

Prop

Type

avatarSize

Prop

Type

avatarColorType

Prop

Type

CoreDotProps

CoreDot를 참조하세요.

CoreStatusBadgeProps

CoreStatusBadge를 참조하세요.

CoreIconBadgeProps

CoreIconBadge를 참조하세요.

스타일

기본 스타일 속성

  • display: flex
  • justify-content: center
  • align-items: center
  • position: relative
  • flex-shrink: 0

Size Variants

SizeWidth/HeightTypographyBorder Radius (Square)
xs16pxfontSize: 8px, fontWeight: 500, paddingTop: 1pxradius-100
sm24pxheading[1]radius-100
md32pxheading[2]radius-100
lg40pxheading[3]radius-100
xl84pxheading[6]radius-200

Shape Variants

  • Circle: border-radius: radius-full
  • Square: border-radius: radius-100 (xs, sm, md, lg) 또는 radius-200 (xl)

Border

  • border-width: 1px
  • border-style: solid
  • border-color: border-default

Color Type Variants (Circle Shape)

Circle 형태일 때 colorType별 색상 토큰:

colorTypecolorbackgroundColor
graygray-70gray-20
redred-60red-20
orangeorange-60orange-20
yellowyellow-70yellow-20
lightGreenlightGreen-70lightGreen-20
greengreen-70green-20
cyancyan-70cyan-20
tealteal-70teal-20
lightBluelightBlue-70lightBlue-20
blueblue-60blue-20
indigoindigo-60indigo-20
purplepurple-60purple-20
magentamagenta-70magenta-20
burgundyburgundy-60burgundy-20

Color Type Variants (Square Shape)

Square 형태일 때 colorType별 색상 토큰:

  • color: white (모든 colorType 동일)
  • backgroundColor: {colorType}-40 (예: gray-40, red-40, blue-40 등)

Image 스타일

  • position: absolute
  • top: 50%
  • left: 50%
  • width: 100%
  • height: 100%
  • transform: translate(-50%, -50%)
  • object-fit: cover
  • border-radius: shape에 따라 radius-full (circle) 또는 size별 radius

Default Icon 스타일

  • width: 100%
  • height: 100%
  • color: white
  • border-radius: shape/size에 따라 결정

Dot Position (Circle Shape)

SizeBorder OnBorder Off
xsright: -1px, top: -1pxright: 0, top: 0
smright: -1px, top: -1pxright: 0, top: 0
mdright: 1px, top: 1pxright: 2px, top: 2px
lgright: 1px, top: 1pxright: 2px, top: 2px
xlright: 6px, top: 6pxright: 7px, top: 7px

Dot Position (Square Shape)

  • Border On: right: -1px, top: -1px
  • Border Off: right: 0, top: 0

Status Badge Position (Circle Shape)

  • Border On: top: calc(10% - 0.5px), left: calc(86% + 0.5px), transform: translate(-50%, -50%)
  • Border Off: top: 10%, left: 86%, transform: translate(-50%, -50%)

Status Badge Position (Square Shape)

  • Border On: top: calc(4% - 1px), left: calc(96% + 1px), transform: translate(-50%, -50%)
  • Border Off: top: 4%, left: 96%, transform: translate(-50%, -50%)

Icon Badge Position (Circle Shape)

  • Border On: right: -5px, bottom: -1px
  • Border Off: right: -4px, bottom: 0

Icon Badge Position (Square Shape)

SizeBorder OnBorder Off
xsright: -5px, bottom: -1pxright: -4px, bottom: 0
smright: -5px, bottom: -1pxright: -4px, bottom: 0
mdright: -5px, bottom: -1pxright: -4px, bottom: 0
lgright: -6px, bottom: -1pxright: -5px, bottom: 0
xlright: -7px, bottom: -1pxright: -6px, bottom: 0