Avatar

Avatars are user profile pictures or similar elements presenting their status (e.g. online or offline).

Albert Einstein Albert Einstein
 
Albert Einstein
 
Albert Einstein
 
Albert Einstein
 
 

<script>
    import { Avatar } from 'svelte-spectre'
</script>

<Avatar name="AV" size="xl" badge="0">
    <img src="/img/avatar-1.png" alt="Albert Einstein" />
    <img slot="sub" src="/img/avatar-2.png" alt="Albert Einstein" />
</Avatar>
<Avatar name="AV" size="lg" status="online" badge="1">
    <img src="/img/avatar-3.png" alt="Albert Einstein" />
</Avatar>
<Avatar name="AV" size="md" status="away" badge="2">
    <img src="/img/avatar-4.png" alt="Albert Einstein" />
</Avatar>
<Avatar name="AV" size="sm" status="busy" badge>
    <img src="/img/avatar-5.png" alt="Albert Einstein" />
</Avatar>
<Avatar name="AV" size="xs" status="offline" />
© 2022 — 2023 BASF SE

API Avatar

name: string = ""
Avatar name for initials
Name Surname
size: Size = "md"
Avatar size
xs | sm | md | lg | xl
status: Status = null
Avatar status
null | online | away | busy | offline
<slot>: HTMLelement
Avatar image
<img> | <svg>
<slot name="sub">: HTMLelement
Avatar subimage
<img> | <svg>
caption: boolean = false
Avatar caption
true | false
badge: string = ""
Avatar badge value
any string
custom: boolean = false
Avatar custom name & bg
true | false