-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add star rating component #253
Add star rating component #253
Conversation
✅ Deploy Preview for streamlit-extras-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hey @GabrielVidal1, thank you for this contribution! Do you mind pulling from |
from streamlit.components.v1 import html | ||
|
||
|
||
def star_rating(rating: float, color="#FFD700"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
color
can be type-hinted as str
:
def star_rating(rating: float, color="#FFD700"): | |
def star_rating(rating: float, color: str = "#FFD700"): |
80b97d9
to
7e6b168
Compare
I did the fixes and rebased on main! |
@GabrielVidal1 sorry I was out for a bit. I didn't catch it last time, but you're missing the from .. import extra
@extra
def star_rating(...):
# original implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above ^, missing @extra
7e6b168
to
89cadb3
Compare
A simple readonly star rating with custom color