Avatar
아바타는 사람이나 사물을 나타내는 데 사용할 수 있습니다. 이미지, 아이콘 또는 문자를 지원합니다.
사용 시기
- 사용자 또는 사물을 나타내는 데 사용되며 이미지, 아이콘 또는 문자의 표시를 지원합니다.
기본
세 가지 크기와 두 가지 모양을 사용할 수 있습니다.
U
U
U
U
U
astro
<Avatar size="sm" alt="User" />
<Avatar size="md" alt="User" />
<Avatar size="lg" alt="User" />
<Avatar size="xl" alt="User" />
<Avatar shape="square" size="md" alt="User" /> 유형
이미지, 아이콘 및 문자가 지원되며, 후자의 두 가지 아바타는 사용자 정의 색상 및 배경색을 가질 수 있습니다.
US
U
astro
<Avatar src="https://avatars.githubusercontent.com/u/1024025?v=4" alt="Linus Torvalds" />
<Avatar alt="User" />
<Avatar class="bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400" alt="U" /> 배지 포함
일반적으로 메시지 알림에 사용됩니다.
OU
OU
BU
AU
astro
<Avatar status="online" alt="Online User" />
<Avatar status="offline" alt="Offline User" />
<Avatar status="busy" alt="Busy User" />
<Avatar status="away" alt="Away User" /> 아바타 그룹
아바타 그룹 표시.
+2
astro
<AvatarGroup>
<Avatar src="https://avatars.githubusercontent.com/u/1?v=4" alt="One" />
<Avatar src="https://avatars.githubusercontent.com/u/2?v=4" alt="Two" />
<Avatar src="https://avatars.githubusercontent.com/u/3?v=4" alt="Three" />
<Avatar alt="+2" />
</AvatarGroup> API
Avatar
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| src | The image source URL for the avatar. | string | - |
| alt | Alternative text for the image, also used to generate initials and colors if src is missing. | string | "" |
| fallback | Explicit text to use for initials and background color generation if src is missing. | string | - |
| size | The size of the avatar. | "sm" | "md" | "lg" | "xl" | "md" |
| shape | The shape of the avatar. | "circle" | "square" | "rounded" | "circle" |
| status | Adds a preset status badge indicating user availability. | "online" | "offline" | "busy" | "away" | - |
| class | Additional CSS classes for custom styling. | string | - |
AvatarGroup
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| class | Additional CSS classes to apply to the avatar group container. | string | - |