🌐 AI搜索 & 代理 主页
Skip to content

Commit 16b10ec

Browse files
authored
Update README.md
1 parent 8c4b362 commit 16b10ec

File tree

1 file changed

+87
-2
lines changed

1 file changed

+87
-2
lines changed

src/components/avatar/README.md

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,96 @@ Group multiple avatars together by wrapping them in a `<b-avatar-group>` compone
459459

460460
**Notes:**
461461

462-
- The `size` prop will be ignored on individual avatars. To size the avatars, use the prop `size`
463-
on `<b-avatar-group>`
462+
-
464463
- The `variant`, `square` and `rounded` props on `<b-avatar-group>` will take precedence over the
465464
respective props on individual avatars.
466465

466+
### Avatar group size
467+
468+
To size the avatars, use the prop `size` on `<b-avatar-group>`. The size prop accepts the same type
469+
of values as the `size` prop on `<b-avatar>`. Note that the `size` prop will be ignored on
470+
individual avatars when they are placed inside a `<b-avatar-group>`.
471+
472+
```html
473+
<template>
474+
<div>
475+
<b-avatar-group size="3rem">
476+
<b-avatar></b-avatar>
477+
<b-avatar></b-avatar>
478+
<b-avatar></b-avatar>
479+
<b-avatar></b-avatar>
480+
<b-avatar></b-avatar>
481+
</b-avatar-group>
482+
</div>
483+
</template>
484+
485+
<!-- b-avatar-group-size.vue -->
486+
```
487+
488+
### Avatar group variant
489+
490+
Use the `variant` prop to color all child avatars in the `<b-avatar-group>`. Note that the `variant`
491+
prop, when set, will override the the `variant` specified on individual avatars.
492+
493+
```html
494+
<template>
495+
<div>
496+
<b-avatar-group variant="success">
497+
<b-avatar></b-avatar>
498+
<b-avatar variant="info"></b-avatar>
499+
<b-avatar></b-avatar>
500+
<b-avatar></b-avatar>
501+
<b-avatar></b-avatar>
502+
</b-avatar-group>
503+
</div>
504+
</template>
505+
506+
<!-- b-avatar-group-variant.vue -->
507+
```
508+
509+
### Avatar group rouding
510+
511+
Similar to the `ariant` prop, the `<b-avatar-group>` props `square` and `rounded` take precedence
512+
over the respective props on individual child avatars.
513+
514+
```html
515+
<template>
516+
<div>
517+
<b-avatar-group rounded="lg">
518+
<b-avatar></b-avatar>
519+
<b-avatar></b-avatar>
520+
<b-avatar></b-avatar>
521+
<b-avatar></b-avatar>
522+
<b-avatar></b-avatar>
523+
</b-avatar-group>
524+
</div>
525+
</template>
526+
527+
<!-- b-avatar-group-rounded.vue -->
528+
```
529+
530+
### Avatar group overlap
531+
532+
By default child avatars inside a `<b-avatar-group>` will overlap by a factor of `0.3` (relative
533+
to the size of the avatar). You can control the overlap amount by setting the `overlap` prop to
534+
a value between `0` and `1`, where `0` means no overlap and `1` means 100% overlap.
535+
536+
```html
537+
<template>
538+
<div>
539+
<b-avatar-group overlap="0.65">
540+
<b-avatar></b-avatar>
541+
<b-avatar></b-avatar>
542+
<b-avatar></b-avatar>
543+
<b-avatar></b-avatar>
544+
<b-avatar></b-avatar>
545+
</b-avatar-group>
546+
</div>
547+
</template>
548+
549+
<!-- b-avatar-group-overlap.vue -->
550+
```
551+
467552
## Accessibility
468553

469554
Use the `aria-label` prop to provide an accessible, screen reader friendly, label for your avatar.

0 commit comments

Comments
 (0)