Avatar

Used for display user’s avatar.

import { Avatar, Icon } from 'react-native-magnus';

<Avatar bg="red300" color="red800">A</Avatar>

<Avatar bg="red300" size={32} color="red800">A</Avatar>

<Avatar bg="red300" size={28} color="red800">A</Avatar>

<Avatar bg="green800">
  <Icon name="user" color="white" fontFamily="Feather" />
</Avatar>

<Avatar bg="green800" rounded="lg">
  <Icon name="user" color="white" fontFamily="Feather" />
</Avatar>

<Avatar
  shadow={1}
  source={{
    uri:
      "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/React-icon.svg/1024px-React-icon.svg.png"
  }}
/>

Avatar Group

<Avatar.Group>
  <Avatar bg="red500" color="white">
    A
  </Avatar>
  <Avatar bg="blue500" color="white">
    B
  </Avatar>
  <Avatar bg="yellow500" color="white">
    C
  </Avatar>
</Avatar.Group>

Props

PropertyDescriptionTypeDefault
mmargin`stringnumber`
mtmargin top`stringnumber`
mrmargin right`stringnumber`
mbmargin bottom`stringnumber`
mlmargin margin left`stringnumber`
mxmargin horizonal`stringnumber`
mymargin vertical`stringnumber`
ppadding`stringnumber`
ptpadding top`stringnumber`
prpadding right`stringnumber`
pbpadding bottom`stringnumber`
plpadding margin left`stringnumber`
pxpadding horizonal`stringnumber`
pypadding vertical`stringnumber`
hheightnumber-
wwidthnumber-
bgbackground colorstring-
sizesize for avatarnumber48
minHmininmum heightnumber-
minWminimum widthstring-
roundedborder radius`stringnumber`
roundedTopborder radius top`stringnumber`
roundedBottomborder radius bottom`stringnumber`
roundedLeftborder radius left`stringnumber`
roundedRightborder radius right`stringnumber`
borderColorcolor for borderstring-
borderTopColorcolor for border topstring-
borderRightColorcolor for border rightstring-
borderLeftColorcolor for border leftstring-
borderBottomColorcolor for border bottomstring-
borderWidthwidth for bordernumber-
borderTopWidthwidth for border topnumber-
borderRightWidthwidth for border rightnumber-
borderLeftWidthwidth for border leftnumber-
borderBottomWidthwidth for border bottomnumber-
shadowdescribe the depth of shadow to be usednumber-
shadowColorcolor for shadowstringgray800
positionused to position the childrens`absolute”“relative”`
topnumber of logical pixels to offset the top edge of this component.number-
rightnumber of logical pixels to offset the right edge of this component.number-
bottomnumber of logical pixels to offset the bottom edge of this component.number-
leftnumber of logical pixels to offset the left edge of this component.number-
sourceimage sourceImageSourcePropType-
fontSizefontSize for textstringmd