Avatar React Native
Tecnologies
Installation
npm install @luanyata/react-native-avatar
#or
yarn add @luanyata/react-native-avatar
Usage
import { Avatar } from "@luanyata/react-native-avatar";
// ...
<Avatar
size={100}
name="Luan Lima"
src="https://avatars.githubusercontent.com/u/39541807?v=4"
/>
Props
Name | Default | Type | Description |
---|---|---|---|
userName | - | String | The user name that will be used to compute user initials. |
initialName | - | String | Force the displayed initials by overriding the computed ones. |
src | - | String | Path of image. |
active | false | Boolean | Whether the user is active or not.(Show active circle around avatar) |
textColor | #FFFF | String | The font color used to render the user initials |
activeCircleColor | #27ae60 | String | Background color active circle |
size | 64 | Number | The avatar size |
rounded | false | Boolean | True if the avatar must be rounded. |
loaderColor | #aaa69d | String | The color of loader |
backgroundColor | - | String | The avatar background color to use if no image is provided |
backgroundColors | ['#575fcf', '#ef5777', '#0be881'] | Array | Array of background colors to choose from, if no background color is specified |
Contributing
Inspired by react-native-user-avatar. Thank you Muhsin Keloth
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library