JumarWeb.AvatarComponents (Jumar v0.1.0)
View SourceProvides avatar components for displaying user profile pictures or initials.
Summary
Functions
Renders an avatar image or initials.
Renders a button with an avatar.
Renders an avatar image based on gravatar email address.
Functions
Renders an avatar image or initials.
This component displays a circular or square avatar. It can show an image from a given src URL, or display initials if no src is provided.
Examples
<.avatar src="/images/user.png" alt="User avatar" />
<.avatar initials="BTK" />
<.avatar src="/images/user.png" square />Attributes
src(:string) - Defaults tonil.square(:boolean) - Defaults tofalse.initials(:string) - Defaults tonil.alt(:string) - Defaults to"".class(:string) - Defaults tonil.- Global attributes are accepted.
 
Renders a button with an avatar.
This component can be used as a button or a link, wrapping an avatar. It's useful for profile buttons that open a dropdown menu, for example.
Examples
<.avatar_button src="/images/user.png" alt="User avatar" />
<.avatar_button initials="BTK" navigate={~p"/profile"} />Attributes
src(:string) - Defaults tonil.square(:boolean) - Defaults tofalse.initials(:string) - Defaults tonil.alt(:string) - Defaults to"".class(:string) - Defaults tonil.- Global attributes are accepted. Supports all globals plus: 
["href", "navigate", "patch", "method"]. 
Renders an avatar image based on gravatar email address.
This component displays a circular or square avatar.
Examples
<.gravatar email="test@example.com" />Attributes
email(:string) (required)size(:string) - Defaults to"64".square(:boolean) - Defaults tofalse.class(:string) - Defaults tonil.- Global attributes are accepted.