logo-icon
STWUI

AvatarGroup

Avatars are used to show a thumbnail representation of an individual or business in the interface.







svelte
<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>

<AvatarGroup size="sm">
	{#each avatars as avatar}
		<AvatarGroup.Avatar src={avatar} />
	{/each}
</AvatarGroup>

<AvatarGroup>
	{#each avatars as avatar}
		<AvatarGroup.Avatar src={avatar} />
	{/each}
</AvatarGroup>

<AvatarGroup size="lg">
	{#each avatars as avatar}
		<AvatarGroup.Avatar src={avatar} class="ring-primary dark:ring-primary" />
	{/each}
</AvatarGroup>

<AvatarGroup size="xl">
	{#each avatars as avatar}
		<AvatarGroup.Avatar src={avatar} />
	{/each}
</AvatarGroup>

AvatarGroup Props

shape 'circle' | 'rounded' | 'square' circle
size 'xs' | 'sm' | 'md' | 'lg' | 'xl' md

AvatarGroup Slots

default <AvatarGroup.Avatar />

AvatarGroup.Avatar Props

src string
alt string avatar
initials string

AvatarGroup.Avatar Slots

placeholder <Avatar.Placeholder slot="placeholder" />
indicator <Avatar.Indicator slot="indicator" />

AvatarGroup.Avatar.Placeholder Slots

icon

AvatarGroup.Avatar.Indicator Props

placement 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left' top-right