1.0.0 • Published 5 years ago

azir-rating v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

Azir Framwork : https://azir.io/docs

Rating

An advance Rating component that should render nicely on any platform. Supports a great level of customization.

Installation

to install the latest version of azir-rating you only need to run:

npm install azir-rating  --save

or

yarn add azir-rating

Examples

Basic :

import Rating from "azir-rating" ;
---
<Rating
  size={60} rating={1}
  scaleSize={80} count={3}
  reviews={["Okay","Good", "Great"]}
  onChange={(rating,previousRating)=>{console.log(rating+" : " +previousRating)}}
/>

Advance with Styles :

import Rating from "azir-rating" ;
import  Icon,{ AzirIcons } from "azir-icon";
---
 <Rating
  reviewColor="red"
  activeColor="red"
  count={7}
  icon={AzirIcons.ThumbUp}
  starContainerStyle={ {borderWidth:1} }
  inActiveColor="#990000"
  reviewStyle={ {fontSize:18} }
  style={ {backgroundColor:"#eee"} }
  containerStyle={ {backgroundColor:"#aaeeaa"} }
  showAnimation={false}
  showScaleEffect={false}
/>

Props

Please make sure to download the latest version of Azir icons.


Reference

icon

Rating Icon.

TypeRequiredDefault
AzirIcons,SolidIcons, RegularIcons, BrandIcons , CustomIconsNoAzirIcons.Star

onChange

Handler to be called when the user change the rating .

we pass two parameters (rating :current selected index,previousRating :previous index )

TypeRequired
functionNO

rating

Initial value for the rating. star rating started from zero.

TypeRequiredDefault
NumberNo2

count

Total number of ratings to display

TypeRequiredDefault
NumberNo5

size

The Size of the Rating Icon

TypeRequiredDefault
azir-sizeNo25

scaleSize

The Size of the Rating Icon when its active

TypeRequiredDefault
azir-sizeNo40

activeColor

Active Rating icon Color.

TypeRequiredDefault
azir-colorNotheme

inActiveColor

In Active Rating icon Color.

TypeRequiredDefault
azir-colorNo#BDC3C7

showAnimation

Show Rating Icons Change Spring animation

TypeRequiredDefault
booleanNotrue

showScaleEffect

Show Rating Icons Change Scaling Effect

TypeRequiredDefault
booleanNotrue

reviews

Labels to show when each value is tapped e.g. If the first star is tapped, then value in index 0 will be used as the label

TypeRequiredDefault
string[]No"Terrible", "Bad", "Okay", "Good", "Great"

reviewSize

The font Size of the Rating Reviews

TypeRequiredDefault
NumberNo25

showRatingReview

If false, we hide rating reviews.

TypeRequiredDefault
boolNotrue

disabled

If true, disable all interactions for this component.

TypeRequiredDefault
boolNofalse

style

override Rating main Container Style

TypeRequired
styleNo

containerStyle

override rating icons container style

TypeRequired
styleNo

starContainerStyle

override Star Container Style

TypeRequired
styleNo

reviewStyle

override review Text style

TypeRequired
styleNo