Coder Social home page Coder Social logo

gaetanozappi / react-native-material-letter-icon Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 467 KB

React Native library to generate Google Inbox style material list icons.

License: Apache License 2.0

Java 76.42% JavaScript 23.58%
react-native material-icons icons

react-native-material-letter-icon's Introduction

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

GitHub package version github home platforms github home npm

github issues github closed issues Issue Stats github license

Library Lollipop

Variations

Library_countries Library_countries_rect Library_round_rect Library_triangle

๐Ÿ“– Getting started

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

$ react-native link react-native-material-letter-icon

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.zappi.ui.material.letter.icon.RNMaterialLetterIconPackage; to the imports at the top of the file
  • Add new RNMaterialLetterIconPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-material-letter-icon'
    project(':react-native-material-letter-icon').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-material-letter-icon/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-material-letter-icon')
    

๐Ÿ’ป Usage

import React, { Component } from 'react';
import {
  Platform,
  StyleSheet,
  Text,
  View
} from 'react-native';
import RNMaterialLetterIcon from 'react-native-material-letter-icon';

type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
      <RNMaterialLetterIcon
      size={80}
      border={true}
      borderColor={"#dd2c00"}
      borderSize={2}
      />
      <RNMaterialLetterIcon
      size={80}
      shapeColor={"#ff5722"}
      shapeType={"round"}
      />
      <RNMaterialLetterIcon
      size={80}
      shapeColor={"#4caf50"}
      shapeType={"triangle"}
      />
      <RNMaterialLetterIcon
      size={80}
      shapeColor={"#303f9f"}
      shapeType={"rect"}
      />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  }
});

๐Ÿ’ก Props

Prop Type Default Note
shapeColor string #1e95cc Shape color resource
shapeType string circle Shape type (circle,rectangle,rect,round)
letter string Leonardo Wilhelm DiCaprio Letter, string or initials to get letters from
letterColor string #ffffff Letter color
letterSize number 26 Letter size
lettersNumber number Letter number
initials bool true Initials enabled
initialsNumber number 3 Initials number
border bool Border enabled
borderColor string Border color
borderSize string Border size

โœจ Credits

๐Ÿ’ซ Contribute

  • Pranav Raj Singh Chauhan: prscx

๐Ÿ“œ License

This library is provided under the Apache License.

react-native-material-letter-icon's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.