1.0.2 • Published 5 years ago

text-drawable v1.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

npm.io npm.io HitCount PRs Welcome

text-drawable

A simple and fully customizable React Native component that implements a Text drawable.

iPhone ScreenAndroid Screen
npm.ionpm.io

Installation

If using yarn:

yarn add text-drawable

If using npm:

npm i text-drawable

Usage

import { ProfileThumbnail, ThumbnailList } from 'text-drawable';

Simply place a <ThumbnailList /> tag with parameter. Drawable container and text are fully customizable using the textStyle, titleStyle, and descriptionStyle props.

<View style={{flex: 1}}>
    <ThumbnailList data={[
            {
                title: "Java",
                description:"Java Description",
                backgroundColor:"green",   
            },
            {
                title: "React native",
                backgroundColor:"red",   
            },
            {
                title: "Javaascript",
                backgroundColor:"blue",   
            }
        ]} 
        label="A" 
        backgroundColor="green"/>
      </View>
</View>

ProfileThumbnail

Example usage to change a single drawable image:

return (
    <View style={{flex: 1}}>
     <ProfileThumbnail
       label="A" 
        backgroundColor="green"/>
    </View>
)

Documentation

ProfileThumbnail Component

NameDescriptionDefaultType
labelDisplay First character of labeloptinalString
sizeSize of text drawable50Number
backgroundColorBack ground color of text drawablegreenString
imageURLAdd image url to load image from urloptinalString
localImageAdd local path to display image from localoptinalobject
textStyleText drawable style for textoptinalobject

ThumbnailList Component

NameDescriptionDefaultType
labelDisplay First character of label stringoptinalString
sizeheight and width of text drawable view50Number
backgroundColorbackgroundColor of text drawable viewoptinalString
imageURLAdd image url to load image from urloptinalString
localImageAdd local path to display image from local(like require("image path"))optinalobject
textStyleText drawable style for textoptinalString
descriptionStyleAdd style for description textoptinalString
titleStyleAdd title style for title textoptinalString
dataPass array for display list{ title: "Java", description:"Java Description", backgroundColor:"green",}, {title: "React native", description:"React native Description", backgroundColor:"red"}Array

Contributing

Pull requests are always welcome! Feel free to open a new GitHub issue for any changes that can be made.

Author

Aniruddh Kukadiya

License

ISC