项目作者: gaetanozappi

项目描述 :
React Native library to generate Google Inbox style material list icons.
高级语言: JavaScript
项目地址: git://github.com/gaetanozappi/react-native-gradient-letter-icon.git
创建时间: 2018-12-24T21:13:03Z
项目社区:https://github.com/gaetanozappi/react-native-gradient-letter-icon

开源协议:Apache License 2.0

下载


React Native: react-native-gradient-letter-icon

GitHub package version
github home
platforms
github home
npm

github issues
github closed issues
Issue Stats
github license

📖 Getting started

$ npm install react-native-gradient-letter-icon --save

$ react-native link react-native-linear-gradient

💻 Usage

  1. import * as React from 'react';
  2. import { StyleSheet, View, Text } from 'react-native';
  3. import MaterialLetter from 'react-native-gradient-letter-icon';
  4. export default class App extends React.Component {
  5. render() {
  6. return (
  7. <View style={styles.container}>
  8. <MaterialLetter style={{ alignSelf: 'center' }} size={80} single ></MaterialLetter>
  9. <MaterialLetter
  10. style={{ alignSelf: 'center' }}
  11. shapeColor={'#ffdf9e'}
  12. letterColor={'#000'}
  13. size={80}
  14. ></MaterialLetter>
  15. <MaterialLetter
  16. style={{ alignSelf: 'center' }}
  17. shapeColor={'#e56969'}
  18. size={80}
  19. shapeType={'round'}
  20. ></MaterialLetter>
  21. <MaterialLetter
  22. style={{ alignSelf: 'center' }}
  23. shapeColor={'#ffc273'}
  24. letterColor={'#000'}
  25. size={80}
  26. shapeType={'rect'}
  27. ></MaterialLetter>
  28. <MaterialLetter
  29. style={{ alignSelf: 'center' }}
  30. shapeColor={['#8a49a1', '#c1558b', '#e56969', '#ffc273', '#ffdf9e']}
  31. size={80}
  32. bold
  33. ></MaterialLetter>
  34. </View>
  35. );
  36. }
  37. }
  38. const styles = StyleSheet.create({
  39. container: {
  40. flex: 1,
  41. justifyContent: 'center',
  42. backgroundColor: '#ecf0f1',
  43. },
  44. });

💡 Props

Prop Type Default Note
shapeColor string #1e95cc Shape color resource
shapeType string circle Shape type (circle,round,rect)
letter string Leonardo Wilhelm DiCaprio Letter, string or initials to get letters from
letterColor string #ffffff Letter color
size number 30 Size MaterialLetter
single bool false If you take only one letter
bold bool false If the text must have the bold feature

📜 License

This library is provided under the Apache License.