PhiaUi.Components.Display.PresenceAvatars (phia_ui v0.1.17)

Copy Markdown View Source

Overlapping avatar stack showing online collaborators (Google Docs-style).

Each avatar shows the user's photo (if available) or initials on a colored background. Includes a status indicator dot (green for online, amber for idle). When more than max_visible users are present, shows a "+N" overflow badge.

Examples

<.presence_avatars
  id="editor-presence"
  users={[
    %{id: "1", name: "Maria Silva", avatar_url: nil, color: "#E53E3E", status: "online", role: "advisor"},
    %{id: "2", name: "João Santos", avatar_url: nil, color: "#3182CE", status: "idle", role: "author"}
  ]}
  max_visible={3}
  size={:sm}
/>

Summary

Functions

Renders an overlapping avatar stack of online collaborators.

Functions

presence_avatars(assigns)

Renders an overlapping avatar stack of online collaborators.

Attributes

  • id — required unique DOM id
  • users — list of maps with keys: id, name, avatar_url, color, status, role
  • max_visible — max avatars to show before overflow (default 3)
  • size:sm (24px) or :md (28px), default :md
  • class — optional extra CSS classes

Attributes

  • id (:string) (required)
  • users (:list) - Defaults to [].
  • max_visible (:integer) - Defaults to 3.
  • size (:atom) - Defaults to :md. Must be one of :sm, or :md.
  • class (:string) - Defaults to nil.