Avatar Group
重なり合うアバターと、残りを表す「+N」:画像またはイニシャル付きの人物、あるいは子のアバターを max で制限し、名前付きの 1 つのグループにします。
対応フレームワーク
Angular: 対応 Vue: 対応 React: 対応 React Native: 対応
使い方
<div class="demo-stack">
<sone-avatar-group ariaLabel="Project members" [people]="people" [max]="3" />
<sone-avatar-group ariaLabel="Reviewers" size="sm">
<sone-avatar role="img" aria-label="Ada Lovelace">
<span soneAvatarFallback aria-hidden="true">AL</span>
</sone-avatar>
<sone-avatar role="img" aria-label="Grace Hopper">
<span soneAvatarFallback aria-hidden="true">GH</span>
</sone-avatar>
</sone-avatar-group>
</div>インポート
import {
SoneAvatarGroupComponent,
} from "@surface-one/angular/avatar-group";API リファレンス
SoneAvatarGroupComponentコンポーネント
`<sone-avatar-group>` — overlapping avatars with a "+N" one for the rest, as one labelled group (the web twin of the React Native `SoneAvatarGroup`). Give `people` (each an image with initials as its fallback, named by `name`), or project `sone-avatar` children; at most `max` show and the group's `size` applies to all. Name the group with `ariaLabel`; the overflow avatar is named by `overflowLabel` ("3 more").
| 名前 | 型 | デフォルト |
|---|---|---|
peoplePeople to draw as avatars (image, then initials); or project `sone-avatar` children. | readonly AvatarGroupPerson[] | null | null |
maxHow many avatars show before the "+N" one. | number | 4 |
size | AvatarSize | "default" |
ariaLabelNames the group ("Project members"). | string | null | null |
overflowLabelThe overflow avatar's accessible name. | (hidden: number) => string | (n) => $localize`:The avatars an avatar group does not show:${n}:count: more` |