Avatar
Los avatares se pueden utilizar para representar personas u objetos. Soporta imágenes, iconos o letras.
Cuándo Usarlo
- Utilizado para representar usuarios o cosas, admitiendo la visualización de imágenes, íconos o caracteres.
Básico
Hay tres tamaños y dos formas disponibles.
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" /> Tipo
Se admiten imágenes, iconos y letras. Los dos últimos pueden tener colores y colores de fondo personalizados.
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" /> Con Insignia
Generalmente se utiliza para recordatorios de mensajes.
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" /> Grupo de Avatares
Visualización de grupo de avatares.
+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
| Propiedad | Descripción | Tipo | Por defecto |
|---|---|---|---|
| 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
| Propiedad | Descripción | Tipo | Por defecto |
|---|---|---|---|
| class | Additional CSS classes to apply to the avatar group container. | string | - |