Avatar
Avatar.Fallback renders until Avatar.Image finishes loading and stays if the image fails. Set size to sm, md, lg, or xl and shape to circle or square.
CNInstallation
Copy the command below and run it in your terminal.
Usage
size defaults to md and shape to circle. alt defaults to an empty string; set it to the person's name unless the name already appears next to the avatar.
Examples
Sizes
MD LG XL
Shapes
CR SQ
With image
CNAnatomy
Avatar.Root - Sets the size and shape.
Avatar.Image - Renders the image and reports when it loads.
Avatar.Fallback - Shows until the image loads, or stays if it fails.
<script lang="ts"> import * as Avatar from '@sivir-ui/svelte/components/avatar'; </script> <Avatar.Root> <Avatar.Image src="https://github.com/shadcn.png" alt="shadcn" /> <Avatar.Fallback>CN</Avatar.Fallback> </Avatar.Root>