<script lang="ts">
import { Avatar } from 'stwui';
</script>
<Avatar src="image.png" size="xs" />
<Avatar src="image.png" size="sm" />
<Avatar src="broken-image.png" />
<Avatar src="image.png" size="lg" />
<Avatar src="image.png" size="xl" />
<script lang="ts">
import { Avatar } from 'stwui';
</script>
<Avatar size="xs" src="image.png">
<Avatar.Indicator slot="indicator" placement="bottom-right" />
</Avatar>
<Avatar size="sm" src="image.png">
<Avatar.Indicator slot="indicator" placement="bottom-right" />
</Avatar>
<Avatar src="image.png">
<Avatar.Indicator slot="indicator" placement="bottom-right" />
</Avatar>
<Avatar size="lg" src="image.png">
<Avatar.Indicator slot="indicator" placement="bottom-right" />
</Avatar>
<Avatar size="xl" src="image.png">
<Avatar.Indicator slot="indicator" placement="bottom-right" />
</Avatar>
<script lang="ts">
import { Avatar } from 'stwui';
</script>
<Avatar size="xs" initials="CH" />
<Avatar size="sm" initials="CH" />
<Avatar initials="CH" />
<Avatar size="lg" initials="CH" />
<Avatar size="xl" initials="CH" />
<script lang="ts">
import { AvatarGroup } from 'stwui';
const avatars = [
'https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80',
'https://images.unsplash.com/photo-1550525811-e5869dd03032?ixlib=rb-1.2.1&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80',
'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2.25&w=256&h=256&q=80',
'https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80'
];
</script>
<AvatarGroup size="xs">
{#each avatars as avatar}
<AvatarGroup.Avatar src={avatar} />
{/each}
</AvatarGroup>
<br />
<AvatarGroup size="sm">
{#each avatars as avatar}
<AvatarGroup.Avatar src={avatar} />
{/each}
</AvatarGroup>
<br />
<AvatarGroup>
{#each avatars as avatar}
<AvatarGroup.Avatar src={avatar} />
{/each}
</AvatarGroup>
<br />
<AvatarGroup size="lg">
{#each avatars as avatar}
<AvatarGroup.Avatar src={avatar} class="ring-primary dark:ring-primary" />
{/each}
</AvatarGroup>
<br />
<AvatarGroup size="xl">
{#each avatars as avatar}
<AvatarGroup.Avatar src={avatar} />
{/each}
</AvatarGroup>
src | string | |
alt | string | avatar |
shape | 'circle' | 'rounded' | 'square' | circle |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | md |
initials | string |
placeholder | <Avatar.Placeholder slot="placeholder" /> |
indicator | <Avatar.Indicator slot="indicator" /> |
icon | <Avatar.Placeholder.Icon slot="icon" /> |
default |
icon | MaterialIcon |
placement | 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left' | top-right |
shape | 'circle' | 'rounded' | 'square' | circle |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | md |
default | <AvatarGroup.Avatar /> |
src | string | |
alt | string | avatar |
initials | string |
placeholder | <Avatar.Placeholder slot="placeholder" /> |
indicator | <Avatar.Indicator slot="indicator" /> |
icon | <Avatar.Placeholder.Icon slot="icon" /> |
default |
icon | MaterialIcon |
placement | 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left' | top-right |