-
Notifications
You must be signed in to change notification settings - Fork 225
Components as props in labels #940
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
Conversation
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.
Thanks for this @AnnMarieW
I've made a few suggestions to get the tests working, but running your examples locally everything looks fine to me. This will be a great addition to the library!
tests/test_components_as_props
Outdated
@@ -0,0 +1,40 @@ | |||
from dash import Dash, dcc, html |
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.
We can also drop dcc
import
tests/test_components_as_props
Outdated
from dash_bootstrap_components import Checklist, Checkbox, RadioButton, RadioItems, Switch | ||
|
||
|
||
def test_mdcap001_components_as_props(dash_dcc): |
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.
I think dash_dcc
is a custom fixture in the dash repo, but swapping this out for dash_duo
worked for me when I tested locally.
flights = html.Div([html.Div(className="fa fa-plane pe-1"), "Flights"]) | ||
car = html.Div([html.Div(className="fa fa-car pe-1"), "Rental Car"]) | ||
hotel = html.Div([html.Div(className="fa fa-hotel pe-1"), "Hotel"]) |
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.
These icons aren't showing up for me when I run the docs because Font Awesome stylesheet isn't actually linked.
We can add the link in docs/templates/partials/head.html
, though I would actually have a preference for changing this example to use Bootstrap icons, since we're already linking the CSS anyway. So less for the reader of the docs to load when they visit.
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
Co-authored-by: Tom Begley <tomcbegley@gmail.com>
updated example to use Bootstrap icons updated icons versions.
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.
Thanks for this!
I just updated the noxfile.py
to format the tests and ran nox -s format
. I also added the new bootstrap icons CDN link to docs/templates/partials/head.html
, since that's where the docs pull the CSS from rather than from dbc.icons
.
Hopefully we'll get all green CI and then I think this is good to go!
Added support for components in props for
Checklist, Checkbox, RadioButton, RadioItems
, andSwitch