1. components
  2. avatar
  3. svelte

Avatar

An image with a fallback for representing the user.

s

Fallback

When src or srcSet are missing or fail to load, a fallback will be displayed. By default this will show the user initials, based on the name. Optionally you can suppy your own content using the default children. This can be used to display icons or implement a custom image using @sveltejs/enhanced-img.

JD

API Reference

Avatar

Property Type Description
src
string
Set avatar image source URL.
srcset
string
The source set of the avatar image.
name *
string
Provide a name or username for the avatar.
filter
string
Set avatar image filter name, such as: "#Apollo".
base
string
Set base styles.
background
string
Set background styles.
size
string
Set size styles.
font
string
Set font styles.
border
string
Set border styles.
rounded
string
Set border radius styles.
shadow
string
Set shadow styles.
classes
string
Provide arbitrary CSS classes.
imageBase
string
Set avatar image base styles.
imageClasses
string
Provide avatar image arbitrary CSS classes.
fallbackBase
string
Set base classes for the fallback element.
fallbackClasses
string
Provide arbitrary CSS classes to fallback element.
children
The default child slot.