🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-native-recommendation

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-recommendation

A React Native component for generating and displaying interactive rating and recommendation views

1.1.2
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

React-Native-Recommendation

npm version Features

  • Net Promoter Score (NPS) view for recommendation and add reviews ( Released :heavy_check_mark: :rocket: )
  • Stars and custom images rating ( Released :heavy_check_mark: :rocket: )

Example

Installation

npm i react-native-recommendation or yarn add react-native-recommendation

Usage

import { Recommendation , Rating } from 'react-native-recommendation'
...

 <Rating 
        titleText={"Rating Test"}
        titleStyle={{ alignSelf: 'center', fontWeight: 'bold'}}
        selectedColor={'red'}
        max={5}
        selectedValue={(value)=> // returns selected value } 
        />
        
 <Recommendation 
        titleText={"Recomendation Test"}
        selectedColor={'red'}
        selectedTextColor={'white'}
        unSelectedTextColor={'black'}
        selectedSize={30}
        max={10}
        selectedValue={(value)=> // returns selected value }
        reactionsEnabled // Remove this to disable reaction icon and text
        />

For customized icons and text do as the following

import { Recommendation } from 'react-native-recommendation'
...
// Add NPS reaction description texts in this order
textList=["FROM 9 -> 10","FROM 6 -> 8","FROM 5 -> 4","FROM 2 -> 3","FROM 0 -> 1"]

// Add NPS reaction icons same as text order
emojiList=[
  require('./assets/ic_love.png'),
  require('./assets/ic_happy.png'),
  require('./assets/ic_confused.png'),
  require('./assets/ic_sad.png'),
  require('./assets/ic_angry.png')
]

...

 <Rating 
        titleText={"Rating Test"}
        titleStyle={{ alignSelf: 'center', fontWeight: 'bold'}}
        selectedColor={'red'}
        max={5}
        selectedValue={(value)=> // returns selected value } 
        customSelected={require('./assets/ic_happy.png')}
        customUnSelected={require('./assets/ic_happy.png')} // default value as customSelected prop
        />

 <Recommendation 
        titleText={"Recomendation Test"}
        selectedColor={'red'}
        selectedTextColor={'white'}
        unSelectedTextColor={'black'}
        selectedSize={30}
        max={10}
        selectedValue={(value)=> // returns selected value }
        reactionsEnabled
         // Add these
        reactionTextList={textList}
        reactionList={emojiList}
        />

Components

<Recommendation/>

<Rating/>

Components Props

<Recommendation/>

PropNotesTypeSignature (func)
titleTextRecommendation upper title textString
titleStyleRecommendation text styleStyle
backgroundColorRecommendation view background colorColor
widthRecommendation view width size (full width is recommended)Number
selectedColorSelected option colorColor
selectedTextColorSelected option text colorColor
selectedSizewidth * height sizes and automatic adjust circular shape --- example: 30 means 30 height, 30 width, and 15 border radiusNumber
maxRecommendation option maximum numbers rangeNumber
selectedValueReturned selected valueCallbackselectedValue={ (value) => // your code }
reactionsEnabledAdding smile faces reactions to recommendation (default false)Boolean
reactionTextListSet reaction test relative to user selectionArray of Strings
reactionListSet reaction images relative to user selectionArray of require(images)
disabledRecommendation selecting disabledBoolean
currentValueRecommendation initial valueNumber

<Rating/>

PropNotesTypeSignature (func)
titleTextRating upper title textString
titleStyleRating text styleStyle
backgroundColorRating view background colorColor
widthRating view width sizeNumber
selectedColorSelected icon colorColor
unSelectedColorUnselected icon colorColor
iconStyleRating icon styleStyle
maxRating option maximum numbers rangeNumber
selectedValueReturned selected valueCallbackselectedValue={ (value) => // your code }
customSelectedSet selected customized rating iconrequire(image)
customUnSelectedSet unselected customized rating icon ( customSelected prop is the default valuerequire(image)
disabledRating selecting disabledBoolean
currentValueRating initial valueNumber

Keywords

react

FAQs

Package last updated on 24 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts