Components as props in labels#940
Conversation
tcbegley
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
tcbegley
left a comment
There was a problem hiding this comment.
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