LanternUI.Components.Avatar (LanternUI v0.8.2)

Copy Markdown View Source

Compact initials or fallback-content avatar. No Fluxon equivalent.

The avatar renders initials when no inner content is supplied. Use the inner block for an image or other host-provided content:

<.avatar initials="AL" />

<.avatar size="lg" shape="square">
  <img src={@profile_image_url} alt="" />
</.avatar>

size accepts xs, sm, md, or lg; shape accepts circle or square.

Summary

Functions

avatar(assigns)

Attributes

  • size (:string) - Defaults to "md". Must be one of "xs", "sm", "md", or "lg".
  • shape (:string) - Defaults to "circle". Must be one of "circle", or "square".
  • initials (:string) - Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block