AvatarGroup
A stack of avatars with a +N avatar for the overflow.
On this page
Examples
Max and overflow
Razor
<div class="flex flex-wrap items-center gap-8">
<KlyAvatarGroup Items="People" Max="3" AriaLabel="Project members" />
<KlyAvatarGroup Items="People" Size="KlySize.Lg" AriaLabel="All members" />
</div>
@code {
private static readonly KlyAvatarItem[] People =
[
new(Alt: "Ada Lovelace"),
new(Alt: "Grace Hopper"),
new(Alt: "Alan Turing"),
new(Alt: "Edsger Dijkstra"),
new(Alt: "Barbara Liskov"),
];
}API
KlyAvatarGroup
Row of overlapping avatars with an optional "+N" counter for the ones that do not fit.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
AriaLabel |
string |
Accessible name of the group ("Project members"). | |
Class |
string |
Classes added to the root element, merged last so they win over the theme. | |
Items (required) |
IReadOnlyList |
The avatars to show, as KlyAvatarItem . | |
Max |
int? |
Most avatars to show; the others collapse into a "+N" avatar. Null shows them all. | |
Size |
KlySize |
KlySize. |
Size of the avatar group, from Xs to Xl . When not set, Size applies, else the default of the component. Values: Xs, Sm, Md, Lg, Xl. |
Ui |
AvatarGroupUi |
Per-instance class overrides of the slots of the avatar group, see AvatarGroupUi . They are merged after the theme and the Class parameter wins on the root slot. |
Ui slots
Ui takes a AvatarGroupUi with one class string per slot, merged after the theme.
| Slot | Styles |
|---|---|
Root |
Classes merged into the root slot of KlyAvatarGroup , after the theme and the app configuration. |
Avatar |
Classes merged into the avatar slot of KlyAvatarGroup , after the theme and the app configuration. |