# `PhoenixKitWeb.Components.Core.UserInfo`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.111/lib/phoenix_kit_web/components/core/user_info.ex#L1)

Provides user information display components.

These components handle user-related data display including roles,
statistics, avatars, and user counts. All components are designed to work
with PhoenixKit's user and role system.

# `primary_role`

Displays user's primary role name.

The primary role is determined as the first role in the user's roles list.
If the user has no roles, displays "No role".

## Attributes
- `user` - User struct with preloaded roles
- `class` - CSS classes

## Examples

    <.primary_role user={user} />
    <.primary_role user={user} class="font-semibold" />

## Attributes

* `user` (`:map`) (required)
* `class` (`:string`) - Defaults to `""`.

# `user_avatar`

Displays user avatar with cascading fallback sources.

Avatar sources are checked in priority order:
1. Uploaded avatar (custom_fields["avatar_file_uuid"]) - PhoenixKit Storage
2. OAuth avatar (custom_fields["oauth_avatar_url"]) - Google/GitHub/etc
3. Gravatar - by email hash (with d=404 for fallback detection)
4. Gradient initials - colored background based on email hash

## Attributes
- `user` - User struct with email and optional custom_fields
- `size` - Avatar size: "xs" (w-6), "sm" (w-8), "md" (w-10), "lg" (w-12). Defaults to "sm"
- `class` - Additional CSS classes

## Examples

    <.user_avatar user={user} />
    <.user_avatar user={user} size="lg" />
    <.user_avatar user={user} size="xs" class="ring ring-primary" />

## Attributes

* `user` (`:map`) (required)
* `size` (`:string`) - Defaults to `"sm"`.
* `class` (`:string`) - Defaults to `""`.

# `users_count`

Displays users count for a specific role.

Retrieves the count from role statistics map and displays it.
If no count is found for the role, displays 0.

## Attributes
- `role` - Role struct with id
- `stats` - Map with role statistics (role_uuid => count)

## Examples

    <.users_count role={role} stats={@role_stats} />
    <.users_count role={role} stats={@role_stats} />

## Attributes

* `role` (`:map`) (required)
* `stats` (`:map`) (required)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
