TeamCard — displays a team member with avatar, name, role, department, email, and optional badge/action slots.
Variants
| Variant | Description |
|---|---|
:default | Centered layout, avatar size :lg |
:compact | Centered layout, avatar size :md, denser spacing |
:horizontal | Row layout, avatar left (size :md), content right |
Examples
<.team_card name="Alice Smith" role="Engineer" department="Platform" email="alice@example.com" />
<.team_card name="Bob" variant={:compact} fallback="B">
<:badges><span>Lead</span></:badges>
<:actions><button>Message</button></:actions>
</.team_card>
<.team_card name="Carol" variant={:horizontal} role="Designer" />
Summary
Functions
Renders a team member card.
Functions
Renders a team member card.
The card layout is controlled by variant:
:default— centered column. Large avatar (:lg) above the member's name, role, department, and email. Badges and action buttons stack below.:compact— centered column, medium avatar and tighter text sizes. Use in dense grids where space is limited.:horizontal— flex row. Medium avatar on the left; name, role, department, email, badges, and actions on the right.
All text fields (role, department, email, badges, actions) are
optional — the layout adapts cleanly when they are not provided.
Examples
<%!-- Minimal team member --%>
<.team_card name="Alice Smith" />
<%!-- Vertical card with all fields --%>
<.team_card
name="Alice Smith"
role="Senior Engineer"
department="Platform"
email="alice@example.com"
src="/avatars/alice.jpg"
fallback="AS"
>
<:badges>
<.badge>Elixir</.badge>
<.badge variant={:outline}>Phoenix</.badge>
</:badges>
<:actions>
<.button size={:sm}>Message</.button>
</:actions>
</.team_card>
<%!-- Horizontal compact team list --%>
<div class="space-y-3">
<.team_card
:for={member <- @team}
name={member.name}
role={member.title}
department={member.department}
src={member.avatar_url}
variant={:horizontal}
/>
</div>Attributes
name(:string) (required) - Team member's display name.role(:string) - Job title. Defaults tonil.department(:string) - Department or team name. Defaults tonil.src(:string) - Avatar image URL. Defaults tonil.fallback(:string) - Initials for avatar fallback. Defaults tonil.email(:string) - Email address. Defaults tonil.variant(:atom) - Layout variant. Defaults to:default. Must be one of:default,:compact, or:horizontal.class(:string) - Additional CSS classes. Defaults tonil.- Global attributes are accepted. HTML attributes forwarded to the outer card.
Slots
badges- Badge chips (role tags, skills, etc.).actions- Action buttons.