MCPcopy Create free account
hub / github.com/callstack/react-native-paper / AvatarExample

Function AvatarExample

example/src/Examples/AvatarExample.tsx:9–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7import ScreenWrapper from '../ScreenWrapper';
8
9const AvatarExample = () => {
10 const { isV3 } = useExampleTheme();
11 return (
12 <ScreenWrapper>
13 <List.Section title="Text">
14 <View style={styles.row}>
15 <Avatar.Text
16 style={[
17 styles.avatar,
18 {
19 backgroundColor: isV3 ? MD3Colors.error70 : MD2Colors.yellow500,
20 },
21 ]}
22 label="XD"
23 color={isV3 ? MD3Colors.primary0 : MD2Colors.black}
24 />
25 <Avatar.Text style={styles.avatar} label="XD" />
26 <Avatar.Text style={styles.avatar} label="XD" size={80} />
27 </View>
28 </List.Section>
29 <List.Section title="Icon">
30 <View style={styles.row}>
31 <Avatar.Icon
32 style={[
33 styles.avatar,
34 {
35 backgroundColor: isV3 ? MD3Colors.error70 : MD2Colors.yellow500,
36 },
37 ]}
38 icon="folder"
39 color={isV3 ? MD3Colors.primary0 : MD2Colors.black}
40 />
41 <Avatar.Icon style={styles.avatar} icon="folder" />
42 <Avatar.Icon style={styles.avatar} icon="folder" size={80} />
43 </View>
44 </List.Section>
45 <List.Section title="Image">
46 <View style={styles.row}>
47 <Avatar.Image
48 style={styles.avatar}
49 source={require('../../assets/images/avatar.png')}
50 />
51 <Avatar.Image
52 style={styles.avatar}
53 source={require('../../assets/images/avatar.png')}
54 size={80}
55 />
56 </View>
57 </List.Section>
58 </ScreenWrapper>
59 );
60};
61
62AvatarExample.title = 'Avatar';
63

Callers

nothing calls this directly

Calls 1

useExampleThemeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…