Skip to content

Commit de85ff1

Browse files
authored
Add Avatar component to ReactLiveScope and update API documentation (#3661)
1 parent 9e9e7ab commit de85ff1

File tree

2 files changed

+93
-8
lines changed

2 files changed

+93
-8
lines changed

docuilib/src/theme/ReactLiveScope/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {Colors, ThemeManager} from 'react-native-ui-lib/style';
44
import {BorderRadiuses, Button, Image, Spacings, Text, TouchableOpacity, View} from 'react-native-ui-lib/core';
55
import ActionBar from 'react-native-ui-lib/actionBar';
66
import Assets from 'react-native-ui-lib/assets';
7+
import Avatar from 'react-native-ui-lib/avatar';
78
import Badge from 'react-native-ui-lib/badge';
89
import Card from 'react-native-ui-lib/card';
910
import Carousel from 'react-native-ui-lib/carousel';
@@ -78,6 +79,7 @@ const ReactLiveScope = {
7879
/* UI Lib's components */
7980
ActionBar,
8081
Assets,
82+
Avatar,
8183
Badge,
8284
BorderRadiuses,
8385
Button,

src/components/avatar/avatar.api.json

Lines changed: 91 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,100 @@
7272
{"name": "ribbonStyle", "type": "ViewStyle", "description": "Ribbon custom style"},
7373
{"name": "ribbonLabelStyle", "type": "TextStyle", "description": "Ribbon label custom style"},
7474
{"name": "customRibbon", "type": "JSX.Element", "description": "Custom ribbon"},
75-
{"name": "isOnline", "type": "boolean", "description": "Determine if to show online badge"},
76-
{
77-
"name": "status",
78-
"type": "StatusModes",
79-
"description": "AWAY, ONLINE, OFFLINE or NONE mode (if set to a value other then 'NONE' will override isOnline prop)"
80-
},
8175
{"name": "size", "type": " number", "description": "Custom size for the Avatar", "default": "50"},
8276
{"name": "onPress", "type": "(props: any) => void", "description": "Press handler"},
8377
{"name": "testID", "type": "string", "description": "Test identifier"}
8478
],
8579
"snippet": [
86-
"<Avatar source={{uri: 'https://lh3.googleusercontent.com/-cw77lUnOvmI/AAAAAAAAAAI/AAAAAAAAAAA/WMNck32dKbc/s181-c/104220521160525129167.jpg'$1}} label={IT$2}/>"
87-
]
80+
"<View flex center row gap-s5>",
81+
"<Avatar",
82+
" size={60$2}",
83+
" source={{uri: 'https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/icons/icon%20examples%20for%20docs/avatar_1.jpg'}$3}",
84+
" badgeProps={{label: '2'}$4}",
85+
" badgePosition={'BOTTOM_RIGHT'}",
86+
" onPress={() => {}}",
87+
"/>",
88+
"<Avatar",
89+
" size={60}",
90+
" source={{uri: 'https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/icons/icon%20examples%20for%20docs/avatar_1.jpg'}}",
91+
" ribbonLabel='NEW'",
92+
"/>",
93+
"</View>"
94+
],
95+
"docs": {
96+
"hero": {
97+
"title": "Avatar",
98+
"description": "An Avatar component is a visual representation of a user or entity, often displayed as a circular image, icon, or placeholder with initials. In mobile app design systems, it is used to personalize the interface by representing users in profiles, chats, notifications, or lists. Avatars help users quickly recognize people, accounts, or items, enhancing both engagement and navigational clarity.",
99+
"type": "hero",
100+
"layout": "horizontal",
101+
"content": [
102+
{
103+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Avatar/avatar_hero.png"
104+
}
105+
]
106+
},
107+
"tabs": [
108+
{
109+
"title": "Overview",
110+
"sections": [
111+
{
112+
"type": "table",
113+
"columns": ["Property", "Component"],
114+
"items": [
115+
{
116+
"title": "Image",
117+
"description": "",
118+
"content": [
119+
{
120+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Avatar/avatar_table01.png"
121+
}
122+
]
123+
},
124+
{
125+
"title": "Initials",
126+
"description": "",
127+
"content": [
128+
{
129+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Avatar/avatar_table04.png"
130+
}
131+
]
132+
}
133+
]
134+
},
135+
{
136+
"type": "table",
137+
"columns": ["Property", "Component"],
138+
"items": [
139+
{
140+
"title": "Badge (online indication)",
141+
"content": [
142+
{
143+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Avatar/avatarPlaceholder_overview_table.png"
144+
}
145+
]
146+
},
147+
{
148+
"title": "Badge with icon",
149+
"description": "Not supported in XXSmall and 3Xsmall.",
150+
"content": [
151+
{
152+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Avatar/avatarPlaceholder_overview_table02.png"
153+
}
154+
]
155+
},
156+
{
157+
"title": "Label",
158+
"description": "Supported only in XLarge, Large and Medium.",
159+
"content": [
160+
{
161+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Avatar/avatarPlaceholder_overview_table03.png"
162+
}
163+
]
164+
}
165+
]
166+
}
167+
]
168+
}
169+
]
170+
}
88171
}

0 commit comments

Comments
 (0)