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-customized-star-rating

v0.1.3

Published

Customized star rating with animation and adding readMe

Downloads

5

Readme

npm version

NPM

React-Native-Customized-Star-Rating Component:

  • Customized animated star rating in react-native which is compatible for both IOS and Android.

Advantages:

  • User can change star view look and feel by changing star image
  • User can customize star image animation by modifying the easing animation value
  • User can give star count to display how many stars required to render
  • Customized star component can accept 2 types of image importing from both local and URL based.

Table of Contents:

  1. Prerequisites
  2. Installation
  3. Props
  4. Demo
  5. Usage
  6. Roadmap
  7. Author

Prerequisites:

shell, brew, watchman, npm, react-native-cli - these are the packages which were need to be installed.

Installation:

  • installing react-native-customized-star-rating plugin and adding dependeices as below
    npm install react-native-customized-star-rating --save
    or
    yarn add react-native-customized-star-rating
  • Adding Dependencies: react-native link react-native-customized-star-rating

Demo:

Props:

| Prop | Type | Description | Required | Default | |---|---|---|---|---| |noOfStars|int| The total number of stars|Yes|NA| |starRowStyle|object| Style required for star row view|Yes|NA| |starSizeStyle|object| Style required for star image view|Yes|NA| |selectedStar|int| Local react state to get selected star id|Yes|NA| |starAnimationScale|int or float | To scale up star image size |Yes|NA| |animationDuration|int| Animation duration time which defines how long animation should play |Yes|NA| |easingType| Easing name | Easing animation type |Yes|NA| |emptyStarImagePath| object | It can accept either local image path or remote image path |Yes|NA| |filledStarImagePath| object | It can accept either local image path or remote image path |Yes|NA| |onClickFunc| callBackfunction() | Define call back function here |Yes|NA|

Usage:

import CustomizedStarRating from 'react-native-customized-star-rating';

class ParentComponent extends Component {
    constructor(props) {
        super(props);
        this.state = {
            scaleAnimation: new Animated.Value(1),
            filledStar: 0,
        }
    }

    clickStar(j) {
        this.setState({ filledStar: j })
    }

    render() {
        return (
            <CustomizedStarRating
                noOfStars={'4'}
                starRowStyle={styles.starRowStyle}
                starSizeStyle={styles.starSizeStyle}
                selectedStar={this.state.filledStar}
                starAnimationScale={1.15}
                animationDuration={300}
                easingType={Easing.easeInCirc}
                emptyStarImagePath={require('../images/emptyStar.png')}
                filledStarImagePath={{ uri: 'https://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/Nautical_star.svg/1200px-Nautical_star.svg.png' }}
                onClickFunc={(i) => this.clickStar(i)}
            />
        );
    }
}

export default ParentComponent

Roadmap:

  • View the project roadmap here

Author: