Avatar

A circular image with a graceful fallback across five sizes.

lily
lily

Installation

npx lily-svelte@latest add avatar

Usage

<script lang="ts">
	import { Avatar } from '$lib/components/ui/avatar';
</script>
 
<Avatar src="/avatars/lily.png" alt="lily" />

Fallback

When src is missing or fails to load, a neutral placeholder icon is shown.

<Avatar alt="Unknown user" />

Sizes

<Avatar size="xs" alt="xs" />
<Avatar size="sm" alt="sm" />
<Avatar alt="default" />
<Avatar size="lg" alt="lg" />
<Avatar size="xl" alt="xl" />

Built by levish. The source code is available on GitHub.

Quiet by design.