0

is there any way to show rating in spfx web part from list as star

enter image description here

1

If you're using React, you can use an NPM package like https://www.npmjs.com/package/react-star-ratings to do what you're looking for.

enter image description here

To use it:

  1. Add the NPM package to your project by using:
npm i react-star-ratings
  1. In your web part's component (where you render the content), add the following import:
import StarRatings from './react-star-ratings';
  1. In your render method, add the star rating control and pass the average rating:
 <StarRatings
        rating={2.403}
      />

Let us know if you're not looking at using an NPM package, or if you aren't using React.

I hope this helps.

1
  • it worked , thank you – kumar Jul 15 '20 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.