ZoonkWeb.Components.Avatar (Zoonk v0.1.0-dev)
View SourceUI component for rendering avatars.
Summary
Functions
Renders an avatar.
Functions
Renders an avatar.
It can use an image or a placeholder if no image is provided.
Examples
# Using an image
<.avatar src="https://example.com/avatar.png" alt="Leo da Vinci" />
# Using a placeholder, no src provided or nil
<.avatar alt="Leo Da Vinci" />
Attributes
src
(:string
) - URL of the avatar image. Defaults tonil
.alt
(:string
) (required) - Alt text for the avatar image - also used as a placeholder if no image is provided.size
(:atom
) - Defaults to:sm
. Must be one of:xs
,:sm
,:md
, or:lg
.class
(:any
) - Defaults tonil
.