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

Commit 75b94a7

Browse files
authored
Update README.md
1 parent 7479beb commit 75b94a7

File tree

1 file changed

+58
-7
lines changed

1 file changed

+58
-7
lines changed

src/components/avatar/README.md

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Avatar
22

3-
> Avatars are typically used to display a user profile as a picture, an icon, or short text.
4-
> `<b-avatar>` provides several props for customizing its appearance such as color variant and
5-
> roundedness, and optionally supports acting as a button, link or
3+
> Avatars are a custom BootstrapVue component, and are typically used to display a user profile as a
4+
> picture, an icon, or short text. `<b-avatar>` provides several props for customizing its appearance
5+
> such as color variant and roundedness, and optionally supports acting as a button, link or
66
> [router link](/docs/reference/router-links).
77
88
## Overview
@@ -24,38 +24,89 @@ TBD
2424

2525
## Avatar types
2626

27-
### Icon
27+
The avatar content can be either a short text string, an iamge, or an icon. Avatar content defaults to
28+
the [`'person-fill'` icon](/docs/icons) when no other content is specified.
29+
30+
### Text content
31+
32+
TBD
33+
34+
### Image content
2835

2936
TBD
3037

31-
### Image
38+
### Icon content
3239

3340
TBD
3441

35-
### Text
42+
### Custom content
43+
44+
Use the `default` slot to render custom content in the avatar, for finer grained control of
45+
its appearance.
3646

3747
TBD
3848

49+
**Note:** the default slot takes precedence over the `text`, `src` and `icon` props.
50+
3951
## Styling
4052

4153
### Variants
4254

55+
Use the `variant` prop to specify on of bootstrap them variant colors:
56+
4357
TBD
4458

4559
### Sizing
4660

4761
TBD
4862

49-
### Rounding and square
63+
### Square
5064

5165
TBD
5266

67+
```html
68+
<template>
69+
<div>
70+
<b-avatar square></b-avatar>
71+
</div>
72+
</template>
73+
74+
<!-- b-avatar-square.vue -->
75+
```
76+
77+
### Rounding
78+
79+
TBD
80+
81+
```html
82+
<template>
83+
<div style="font-size: 3rem;">
84+
<b-avatar rounded="sm"></b-avatar>
85+
<b-avatar rounded></b-avatar>
86+
<b-avatar rounded="lg"></b-avatar>
87+
</div>
88+
</template>
89+
90+
<!-- b-avatar-rounding.vue -->
91+
```
92+
5393
## Actionalble avatars
5494

95+
Easily create avatars that respond to clicks, or change the URL/route.
96+
5597
### Button
5698

5799
TBD
58100

59101
### Link
60102

61103
TBD
104+
105+
## Accessibility
106+
107+
Use the `aria-label` prop to provide an accessible, screen reader friendly, label for your avatar.
108+
The default `aria-label` is `'avatar'`.
109+
110+
## Implementation notes
111+
112+
TBD

0 commit comments

Comments
 (0)