npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-star-rating-view

v0.0.12

Published

StarRatingView for react-native, supporting decimal fraction and sliding rating.(星星评价打分组件:支持小数、滑动打分)

Downloads

471

Readme

react-native-star-rating-view

StarRatingView for react-native, supporting decimal fraction and sliding rating. Inspired by HCSStarRatingView

Demo

see the Demo

image

Install

Note: need react-native-vector-icons

If you do not want to import react-native-vector-icons, try the purejs branch

npm install react-native-star-rating-view --save

Usage


import StarRatingBar from 'react-native-star-rating-view/StarRatingBar'

...

// readOnly, allow accurate value(只读、显示小数)
<StarRatingBar
    score={2.3}
    dontShowScore={false} // true: not show the score text view
    allowsHalfStars={true}
    accurateHalfStars={true}
/>
// sliding rating, not allow accurate value(滑动打分、不允许小数)
<StarRatingBar
    readOnly={false}
    continuous={true}
    score={3.7}
    onStarValueChanged={(score) => {
        console.log('new score:' + score);
    }}
/>
// sliding rating, allow accurate value(滑动打分、精确到小数)
<StarRatingBar
    starStyle={{
        width: 20,
        height: 20,
    }}
    readOnly={false}
    continuous={true}
    score={3.7}
    allowsHalfStars={true}
    accurateHalfStars={true}
    onStarValueChanged={(score) => {
        console.log('new score:' + score);
    }}
/>

customize star image(自定义图片)


// readOnly(默认只读、不显示小数)
<StarRatingBar
    score={2.3}
    //emptyStarColor='#ff6666'
    //tintColor='#ff6666'
    emptyStarImage={<Image style={{width:16, height: 16}} source={{uri: 'emptyStar.png: your image path'}} />}
    filledStarImage={<Image style={{width:16, height: 16}} source={require('star.png: your image path')} />}
    scoreTextStyle={{color:'#ff6666'}}
/>

// customize star size(自定义尺寸大小)
<View style={{height: 60, flexDirection: 'row', alignItems: 'center'}}>
    <StarRatingBar
        score={2.3}
        //emptyStarColor='#ff6666'
        //tintColor='#ff6666'
        starStyle={{
            width: 26,
            height: 26,
        }}
        emptyStarImage={<Image style={{width: 26, height: 26}} source={{uri: 'emptyStar.png: your image path'}} />}
        filledStarImage={<Image style={{width: 26, height: 26}} source={require('star.png: your image path')} />}
        scoreTextStyle={{color:'#ff6666'}}
    />
</View>

License

MIT