PetalComponents.Avatar (petal_components v4.5.0)

Copy Markdown View Source

Summary

Functions

avatar(assigns)

Attributes

  • src (:string) - hosted avatar URL. Defaults to nil.
  • alt (:string) - alt text for avatar image. Defaults to nil.
  • size (:string) - Defaults to "md". Must be one of "xs", "sm", "md", "lg", or "xl".
  • class (:any) - CSS class. Defaults to nil.
  • name (:string) - name for placeholder initials. Defaults to nil.
  • random_color (:boolean) - generates a random color for placeholder initials avatar. Defaults to false.
  • status (:string) - presence dot on the bottom-right corner, ringed to separate from the image. Defaults to nil. Must be one of nil, "online", "offline", "busy", or "away".
  • Global attributes are accepted.

avatar_group(assigns)

Attributes

  • size (:string) - Defaults to "md". Must be one of "xs", "sm", "md", "lg", or "xl".
  • class (:any) - CSS class. Defaults to nil.
  • avatars (:list) - list of your hosted avatar URLs. Defaults to [].
  • max (:integer) - show at most this many avatars, then a +N overflow bubble for the rest. Defaults to nil.
  • Global attributes are accepted.