1.0.7 • Published 4 years ago

react-native-customer-review-bars v1.0.7

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

react-native-customer-review-bars

A customizables ListView that allows you to display customer review scale.

Install

Using NPM

npm install react-native-customer-review-bars

Using Yarn

yarn add react-native-customer-review-bars

Example

npm.ionpm.io

Usage

import React, { Component } from "react";
import { View } from "react-native";
import Review from "react-native-customer-review-bars";

const reviews = [
  { value: 10000 },
  { value: 500 },
  { value: 456 },
  { value: 350 },
  { value: 500 }
];
// --- OR ---
// const  reviews = [
//   { value: 10000 , type:"Excellent"},
//   { value: 500 ,type:"Great"},
//   { value: 456 },
//   { value: 350 },
//   { value: 500 }
// ];
// to make custom messages
class App extends Component {
  render() {
    return <Review reviews={reviews} />;
  }
}
export default App;

Properties

PropDefaultTypeDescription
reviews[]arrayAll items available in the list (array of string or { type, value })
showPercentagefalseboolDisplay percentage of reviews
showCountfalseboolDisplay count of reviews
colors["#4CAF50", "#2196F3", "#00bcd4", "#ff9800", "#f44336"]ArrayChange color of bars
reviewTypeStyle{}objectStyle for the "type" label.
rightTextStyle{}objectStyle for the "percentage or value" label.
flatListProps{}objectFlatList for pass flatlist props inside the component.
barStyle{}objectStyle for the "empty barStyle" style.
barFillStyle{}objectStyle for the "filled bar" style.

License

© Suraj Sanwal