This component also expresses all of the Common Component Props for ComponentProps<'table'>, except cellPadding and cellSpacing.
AvatarGroup
Use JSX email to build production-ready email templates with React and TypeScript. Prefer JSX email components and helpers from `jsx-email` for email-client compatibility. Use `render` to generate HTML strings for providers like Resend, Postmark, SendGrid, Nodemailer, AWS SES, Loops, or Plunk, and use the CLI preview/check/build workflow while developing. Favor simple, standards-compliant email markup, account for inconsistent email client CSS support, use the `Tailwind` component when utility styling is helpful, and run `email check` before sending when compatibility matters. For complete agent-readable documentation, fetch https://jsx.email/llms-full.txt before implementing. Implement or refactor with the `AvatarGroup` component when it fits the email's content and layout. Use only to arrange `Avatar` children. Use `max` for long groups, `direction` for RTL layouts, and keep `overlap`/`spacing` conservative because negative margins vary by client. Reference the component docs at https://jsx.email/docs/components/avatar-group.
Displays a group of avatars with optional overlap
pnpm
aube
bun
npm
yarn
pnpm add jsx-emailUsage
AvatarGroup arranges Avatar children in a row.
import { Avatar, AvatarGroup } from 'jsx-email';
const Email = () => {
return (
<AvatarGroup>
<Avatar name="Bruce Wayne" />
<Avatar name="Selina Kyle" />
<Avatar name="Clark Kent" />
</AvatarGroup>
);
};Use overlap only when needed:
import { Avatar, AvatarGroup } from 'jsx-email';
const Email = () => {
return (
<AvatarGroup overlap={true} spacing={10}>
<Avatar name="Bruce Wayne" />
<Avatar name="Selina Kyle" />
<Avatar name="Clark Kent" />
</AvatarGroup>
);
};Truncate long groups with a +N overflow token:
import { Avatar, AvatarGroup } from 'jsx-email';
const Email = () => {
return (
<AvatarGroup max={3}>
<Avatar name="Bruce Wayne" />
<Avatar name="Selina Kyle" />
<Avatar name="Clark Kent" />
<Avatar name="Diana Prince" />
</AvatarGroup>
);
};Render in reverse order for right-to-left layouts:
import { Avatar, AvatarGroup } from 'jsx-email';
const Email = () => {
return (
<AvatarGroup direction="rtl">
<Avatar name="Bruce Wayne" />
<Avatar name="Selina Kyle" />
<Avatar name="Clark Kent" />
</AvatarGroup>
);
};Component Props
direction?: 'ltr' | 'rtl';Controls group rendering order. Defaults to "ltr".
max?: number;Maximum number of avatars to render before appending an overflow token (for example, +2).
overlap?: boolean;If true, overlaps avatars. Defaults to false for compatibility-safe rendering.
spacing?: number;Spacing in pixels between avatars. Defaults to 8.
disableDefaultStyle?: boolean;If true, instructs the component not to add default style properties to the component. This can be useful when attempting to override default styles with Tailwind or class names.
Caveats
overlap={true}is an enhanced mode that depends on negative margins and layered stacking. Rendering can vary across older or stricter email clients.- Keep overlap values conservative and verify output with
email checkbefore sending.
Tips