<Avatar bgColor="$amber600" size="md" borderRadius="$full"><AvatarFallbackText>Sandeep Srivastava</AvatarFallbackText></Avatar>
import {Avatar,AvatarBadge,AvatarFallbackText,AvatarImage,} from "@gluestack-ui/themed"
export default () => (<AvatarGroup><Avatar><AvatarFallbackText /><AvatarImage /><AvatarBadge /></Avatar></AvatarGroup>)
Sx Prop | Description |
---|---|
_badge | Prop to style AvatarBadge Component |
_text | Prop to style AvatarFallbackText Component |
Sx Prop | Description |
---|---|
_avatar | Prop to style Avatar Component |
Name | Value | Default |
---|---|---|
size | xs | sm | md | lg | xl | 2xl | md |
<VStack space="2xl"><HStack space="md"><Avatar bgColor="$indigo600"><AvatarFallbackText>Ronald Richards</AvatarFallbackText><AvatarBadge $dark-borderColor="$black" /></Avatar><VStack><Heading size="sm">Ronald Richards</Heading><Text size="sm">Nursing Assistant</Text></VStack></HStack><HStack space="md"><Avatar bgColor="$orange600"><AvatarFallbackText>Arlene McCoy</AvatarFallbackText></Avatar><VStack><Heading size="sm">Arlene McCoy</Heading><Text size="sm">Marketing Coordinator</Text></VStack></HStack></VStack>
<VStack space="2xl"><HStack space="md"><Avatar bgColor="$indigo600">{/* User is imported from 'lucide-react-native' */}<Icon as={User} color="white" size="lg" /></Avatar><VStack><Heading size="sm">Ronald Richards</Heading><Text size="sm">Nursing Assistant</Text></VStack></HStack><HStack space="md"><Avatar bgColor="$pink600">{/* User is imported from 'lucide-react-native' */}<Icon as={User} color="white" size="lg" /></Avatar><VStack><Heading size="sm">Kevin James</Heading><Text size="sm">Web Designer</Text></VStack></HStack></VStack>
<VStack space="2xl"><HStack space="md"><Avatar><AvatarFallbackText>SS</AvatarFallbackText><AvatarImagesource={{uri: "https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8dXNlcnxlbnwwfHwwfHw%3D&auto=format&fit=crop&w=800&q=60",}}/></Avatar><VStack><Heading size="sm">Ronald Richards</Heading><Text size="sm">Nursing Assistant</Text></VStack></HStack><HStack space="md"><Avatar><AvatarFallbackText>SS</AvatarFallbackText><AvatarImagesource={{uri: "https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8dXNlcnxlbnwwfHwwfHw%3D&auto=format&fit=crop&w=800&q=60",}}/></Avatar><VStack><Heading size="sm">Arlene McCoy</Heading><Text size="sm">Marketing Coordinator</Text></VStack></HStack></VStack>
function App() {const avatars = [{src: "https://example.com.jpg",alt: "Sandeep Srivastva",color: "$emerald600",},{ src: "https://example.com.jpg", alt: "Arjun Kapoor", color: "$cyan600" },{src: "https://example.com.jpg",alt: "Ritik Sharma ",color: "$indigo600",},{ src: "https://example.com.jpg", alt: "Akhil Sharma", color: "$gray600" },{ src: "https://example.com.jpg", alt: "Rahul Sharma ", color: "$red400" },]const extraAvatars = avatars.slice(3)const remainingCount = extraAvatars.lengthreturn (<AvatarGroup>{avatars.slice(0, 3).map((avatar, index) => {return (<Avatarkey={index}size="lg"borderColor="$white"borderWidth="$2"bg={avatar.color}$dark-borderColor="$black"><AvatarFallbackText>{avatar.alt}</AvatarFallbackText></Avatar>)})}<Avatarsize="lg"borderColor="$white"borderWidth="$2"bg="$gray600"$dark-borderColor="$black"><AvatarFallbackText>{"+ " + remainingCount + ""}</AvatarFallbackText></Avatar></AvatarGroup>)}
<AvatarGroup><Avatar size="md"><AvatarFallbackText>John Doe</AvatarFallbackText><AvatarImagesource={{uri: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80",}}/></Avatar><Avatar size="md"><AvatarFallbackText>John Doe</AvatarFallbackText><AvatarImagesource={{uri: "https://images.unsplash.com/photo-1603415526960-f7e0328c63b1?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80",}}/></Avatar><Avatar size="md"><AvatarFallbackText>John Doe</AvatarFallbackText><AvatarImagesource={{uri: "https://images.unsplash.com/photo-1614289371518-722f2615943d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80",}}/></Avatar><Avatar size="md"><AvatarFallbackText>John Doe</AvatarFallbackText><AvatarImagesource={{uri: "https://images.unsplash.com/photo-1607746882042-944635dfe10e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80",}}/></Avatar></AvatarGroup>
<AvatarGroup><Avatar size="md"><AvatarFallbackText>John Doe</AvatarFallbackText><AvatarImagesource={{uri: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80",}}/><AvatarBadge $dark-borderColor="$black" /></Avatar><Avatar size="md"><AvatarFallbackText>John Doe</AvatarFallbackText><AvatarImagesource={{uri: "https://images.unsplash.com/photo-1603415526960-f7e0328c63b1?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80",}}/><AvatarBadge $dark-borderColor="$black" /></Avatar><Avatar size="md"><AvatarFallbackText>John Doe</AvatarFallbackText><AvatarImagesource={{uri: "https://images.unsplash.com/photo-1614289371518-722f2615943d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80",}}/><AvatarBadge $dark-borderColor="$black" /></Avatar><Avatar size="md"><AvatarFallbackText>John Doe</AvatarFallbackText><AvatarImagesource={{uri: "https://images.unsplash.com/photo-1607746882042-944635dfe10e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80",}}/><AvatarBadge $dark-borderColor="$black" /></Avatar></AvatarGroup>
<VStack space="2xl"><HStack space="md"><Avatarsize="md"bgColor="$indigo300"borderColor="$indigo600"borderWidth={2}>{/* User is imported from 'lucide-react-native' */}<Icon as={User} color="$indigo600" size="xl" /></Avatar><VStack><Heading size="sm">Ronald Richards</Heading><Text size="sm">Nursing Assistant</Text></VStack></HStack><HStack space="md"><Avatar size="md" bgColor="$pink300" borderColor="$pink600" borderWidth={2}>{/* User is imported from 'lucide-react-native' */}<Icon as={User} color="$pink600" size="xl" /></Avatar><VStack><Heading size="sm">Kevin James</Heading><Text size="sm">Web Designer</Text></VStack></HStack></VStack>
<HStack space="md" h="100%" justifyContent="center" alignItems="center"><Avatar size="md"><AvatarFallbackText>John Doe</AvatarFallbackText><AvatarImagesource={{uri: "https://wrong-url",}}/></Avatar></HStack>