Data displayTeamMember
Searchastronomic.dev# TeamMember
For one person in a Team section: their photo, name, role, a short bio and links. The team recipes use it for you.
Static: no JavaScript.
## Usage
```astro
import TeamMember from "@astronomic-dev/ui/components/TeamMember.astro";
```
## Examples
### In a Team list
Two people, each a TeamMember in an <li>: one with a large photo, a short bio and links (photo, the default), her name linking to her page (href: the whole card opens it, her own links stay links of their own), one as a small round avatar beside the name and role (variant="avatar"), with no photo, so the initials show. The team recipes build their people from it, so you only need it for your own layout.
```astro
---
import Mail from "@lucide/astro/icons/mail";
import Team from "@astronomic-dev/ui/components/Team.astro";
import TeamMember from "@astronomic-dev/ui/components/TeamMember.astro";
import { childHeadingTag } from "@astronomic-dev/ui/lib/heading.ts";
// Your own photo.
import lena from "../../photos/portrait-glasses.webp";
const heading = "Who you will work with";
// One level under the section heading: h2 gives h3.
const tag = childHeadingTag({ heading });
---
<div class="mx-auto max-w-6xl">
<Team heading={heading} listClass="grid-cols-[repeat(auto-fit,minmax(min(100%,13rem),1fr))] gap-x-cards gap-y-blocks">
<li class="grid min-w-0">
<TeamMember
name="Lena Ruiz"
role="Content strategist"
href="#lena-ruiz"
image={{ src: lena }}
bio="Lena plans every page with you before a word is written, so the site says what your clients ask."
links={[
{ label: "LinkedIn", href: "#lena-linkedin" },
{ label: "Email", href: "mailto:lena@example.com", icon: Mail },
]}
headingTag={tag}
/>
</li>
<li class="grid min-w-0">
<TeamMember variant="avatar" name="Sam Okafor" role="Lead developer" headingTag={tag} />
</li>
</Team>
</div>
```
## Props
### TeamMember
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `name` | `string` | None | Required. The person's name: the item heading, and the initials when there is no photo. |
| `role` | `string` | None | Required. Their job, such as "Design lead", in the small role, muted, under the name. |
| `href` | `string` | None | Their own page. With it, the name is the card's one link, stretched over the whole card, so a click anywhere opens the page and the focus ring goes round the card; the photo stays decoration, and their own links sit above the stretched area, still clicked and tabbed to on their own. Without it, no link. The recipes pass it on. |
| `image` | `DecorativeImage` | None | Their photo: { src, width?, height?, focalPoint?, loading? } (DecorativeImage in lib/image.ts). There is no alt: the part writes alt="", since the name is right under it. Without it, the initials show in the same box, so a row of people never breaks. |
| `imageComponent` | `ImageComponent` | None | Your image component for the photo (Media's imageComponent). Not for an Avatar. |
| `imageSizes` | `string` | None | How wide the photo shows, for imageComponent's sizes. The recipes set it. |
| `bio` | `string` | None | A few sentences about them, muted, at a reading width. |
| `links` | `TeamLink[]` | `[]` | Their links: { label, href, icon? } (TeamLink). The label shows; a screen reader hears it with the name. icon is your own Astro component (Lucide's, or your own), shown before the label. |
| `quote` | `string` | None | A line in their own words, above the name, in the quote role, sized to the person's box (TeamSpotlight shows it). |
| `headingTag` | `"h2" \| "h3" \| "h4" \| "h5"` | None | Required. The name element. Pass childHeadingTag({ heading, headingTag }) from lib/heading.ts, one level under the section heading. |
| `variant` | `"photo" \| "avatar"` | `"photo"` | photo: a large photo above the name. avatar: a small round Avatar beside the name and role, for a compact list. |
| `ratioClass` | `string` | `"aspect-[4/5]"` | The photo box's ratio, as classes, such as aspect-square. photo only. |
| `mediaClass` | `string` | None | For recipes. Classes for the photo box (the photo, the initials or the Avatar). |
| `bodyClass` | `string` | None | For recipes. Classes for the text box (the quote, name, role, bio and links). |
| `class` | `string` | None | More classes for the root <div>, merged with cn(), so yours win on conflicts. The root is a named size container (team-member), so the initials and a quote size to the person's own box. |
Any other attribute goes on the root <div>.
## Accessibility
- Renders one <div>: put it in an <li> in a Team list.
- The name is a heading one level under the section heading: pass childHeadingTag, so a reader can jump from person to person.
- The photo has empty alt text, since the name is right under it. The initials, when there is no photo, are hidden from screen readers.
- Each link is read with the person's name: the visible "LinkedIn" is read as "Ada Brook on LinkedIn".
- An icon is hidden from screen readers. If you show only icons, give each link a label anyway: it is still read with the name.
TeamMember
FreeFor one person in a Team section: their photo, name, role, a short bio and links. The team recipes use it for you.
- File
- TeamMember.astro
- Group
- Data display
- Kind
- Static: no JavaScript
- Examples
- 1
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
In a Team list
Two people, each a TeamMember in an <li>: one with a large photo, a short bio and links (photo, the default), her name linking to her page (href: the whole card opens it, her own links stay links of their own), one as a small round avatar beside the name and role (variant="avatar"), with no photo, so the initials show. The team recipes build their people from it, so you only need it for your own layout.
Who you will work with

Lena Ruiz
Content strategist
Lena plans every page with you before a word is written, so the site says what your clients ask.
Sam Okafor
Lead developer
examples/teammember/main.astro
---
import Mail from "@lucide/astro/icons/mail";
import Team from "@astronomic-dev/ui/components/Team.astro";
import TeamMember from "@astronomic-dev/ui/components/TeamMember.astro";
import { childHeadingTag } from "@astronomic-dev/ui/lib/heading.ts";
// Your own photo.
import lena from "../../photos/portrait-glasses.webp";
const heading = "Who you will work with";
// One level under the section heading: h2 gives h3.
const tag = childHeadingTag({ heading });
---
<div class="mx-auto max-w-6xl">
<Team heading={heading} listClass="grid-cols-[repeat(auto-fit,minmax(min(100%,13rem),1fr))] gap-x-cards gap-y-blocks">
<li class="grid min-w-0">
<TeamMember
name="Lena Ruiz"
role="Content strategist"
href="#lena-ruiz"
image={{ src: lena }}
bio="Lena plans every page with you before a word is written, so the site says what your clients ask."
links={[
{ label: "LinkedIn", href: "#lena-linkedin" },
{ label: "Email", href: "mailto:lena@example.com", icon: Mail },
]}
headingTag={tag}
/>
</li>
<li class="grid min-w-0">
<TeamMember variant="avatar" name="Sam Okafor" role="Lead developer" headingTag={tag} />
</li>
</Team>
</div>