awran5 / react-simple-star-rating

A simple react component for adding a star rating to your project.
https://react-simple-star-rating.vercel.app/
MIT License
134 stars 30 forks source link

Rating icons display vertically #29

Open maxratajczak opened 1 year ago

maxratajczak commented 1 year ago

When I display the rating, the icons are stacked vertically, I tried setting it in a flexbox but it didn't help.

Screen Shot 2022-10-19 at 3 30 49 PM Screen Shot 2022-10-19 at 3 31 03 PM
awran5 commented 1 year ago

Hi @maxratajczak

Try to add the flex className to emptyClassName prop:


<Rating 
...
emptyClassName="flex"
...
 />

Or add some CSS to your stylesheet:

.react-simple-star-rating .filled-icons {
  display: inline-block !important;
}

.react-simple-star-rating .empty-icons {
  display: flex !important;
}
sumanthpweb11 commented 1 year ago

Tried it all Shows Vertical please fix it

micartey commented 1 year ago

I have the same issue 👀

HardeepsinhSodha commented 1 year ago

Change SVG element display property from block to inline-block. I am using Tailwind CSS so I can directly do this by adding class "inline-block". You might need to create "inline-block" custom class. <Rating ... SVGclassName="inline-block" />

yuuriresende commented 1 year ago

Thanks @HardeepsinhSodha !!

OttlikG commented 1 year ago

The following fixed me:

<Rating
    ...
    SVGstyle={{display: "inline-block"}}
/>

By the way I use Chakra UI, its global CSS might break the CSS.

michael-2509 commented 1 year ago

image image @HardeepsinhSodha, @awran5 I am using tailwind and have tried the SVGclassName approach and it still appears vertical

Baalamurgan commented 1 year ago

image image @HardeepsinhSodha, @awran5 I am using tailwind and have tried the SVGclassName approach and it still appears vertical

Same issue here!

pmkod commented 11 months ago

https://github.com/awran5/react-simple-star-rating/issues/41