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:flexjustify-content:centeralign-items:centerposition:relativeflex-shrink:0
Size Variants
| Size | Width/Height | Typography | Border Radius (Square) |
|---|---|---|---|
xs | 16px | fontSize: 8px, fontWeight: 500, paddingTop: 1px | radius-100 |
sm | 24px | heading[1] | radius-100 |
md | 32px | heading[2] | radius-100 |
lg | 40px | heading[3] | radius-100 |
xl | 84px | heading[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:1pxborder-style:solidborder-color:border-default
Color Type Variants (Circle Shape)
Circle 형태일 때 colorType별 색상 토큰:
| colorType | color | backgroundColor |
|---|---|---|
gray | gray-70 | gray-20 |
red | red-60 | red-20 |
orange | orange-60 | orange-20 |
yellow | yellow-70 | yellow-20 |
lightGreen | lightGreen-70 | lightGreen-20 |
green | green-70 | green-20 |
cyan | cyan-70 | cyan-20 |
teal | teal-70 | teal-20 |
lightBlue | lightBlue-70 | lightBlue-20 |
blue | blue-60 | blue-20 |
indigo | indigo-60 | indigo-20 |
purple | purple-60 | purple-20 |
magenta | magenta-70 | magenta-20 |
burgundy | burgundy-60 | burgundy-20 |
Color Type Variants (Square Shape)
Square 형태일 때 colorType별 색상 토큰:
color:white(모든 colorType 동일)backgroundColor:{colorType}-40(예:gray-40,red-40,blue-40등)
Image 스타일
position:absolutetop:50%left:50%width:100%height:100%transform:translate(-50%, -50%)object-fit:coverborder-radius: shape에 따라radius-full(circle) 또는 size별 radius
Default Icon 스타일
width:100%height:100%color:whiteborder-radius: shape/size에 따라 결정
Dot Position (Circle Shape)
| Size | Border On | Border Off |
|---|---|---|
xs | right: -1px, top: -1px | right: 0, top: 0 |
sm | right: -1px, top: -1px | right: 0, top: 0 |
md | right: 1px, top: 1px | right: 2px, top: 2px |
lg | right: 1px, top: 1px | right: 2px, top: 2px |
xl | right: 6px, top: 6px | right: 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)
| Size | Border On | Border Off |
|---|---|---|
xs | right: -5px, bottom: -1px | right: -4px, bottom: 0 |
sm | right: -5px, bottom: -1px | right: -4px, bottom: 0 |
md | right: -5px, bottom: -1px | right: -4px, bottom: 0 |
lg | right: -6px, bottom: -1px | right: -5px, bottom: 0 |
xl | right: -7px, bottom: -1px | right: -6px, bottom: 0 |