1.0.1 • Published 5 years ago

@rn-components-kit/rating v1.0.1

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

Rating

NPM version

English | 中文

Ratings are used to collect measurable feedback from users. It supports the following features:

  • touch and move operation
  • customized active/inactive icon (type, color, size)
  • different step values (e.g. 0.1/0.2/0.5/1)

How to use

npm install @rn-components-kit/rating --save
PreviewCode
Demo1 Code
Demo2 Code
Demo3 Code

Props

Reference

Props

style

Allows you to customize style

TypeRequiredDefault
objectno-

step

The granularity that Rating can step through values

TypeRequiredDefault
enum(0.1, 0.2, 0.5, 1)no1

total

Count of star

TypeRequiredDefault
numberno5

value

Current count of active star

TypeRequiredDefault
numberno0

iconGap

Space between stars

TypeRequiredDefault
numberno4

iconSize

Size of star icon

TypeRequiredDefault
numberno20

disabled

Determines whether value can be changed

TypeRequiredDefault
booleannofalse

activeIconType

Icon type when it is active

TypeRequiredDefault
enum valueno'star-fill'

activeIconColor

Icon color when it is active

TypeRequiredDefault
stringno'#FADB14'

inActiveIconType

Icon type when it is inactive

TypeRequiredDefault
enum valueno'star-fill'

inActiveIconColor

Icon color when it is inactive

TypeRequiredDefault
stringno'#E8E8E8'

onValueChange

(value: number) => void

A callback will be triggered when Rating's value changes

TypeRequiredDefault
functionno() => {}