Conversation
tcbegley
left a comment
There was a problem hiding this comment.
This looks great! Thanks so much @AnnMarieW!
I was wondering if we should add props like n_clicks_next and n_clicks_previous so that you can hook up advancing the slide to a callback? I suppose you can already connect to the active_index prop so maybe that's not necessary. What do you think? I'm already not so sure of the idea having written it out 😛
Anyway, other than the minor comments I'm very happy with the component itself. It would be great if we could also add some unit tests and some documentation. For documentation most of the sections borrow heavily from the examples in the official Bootstrap documentation. For the tests I think checking that the children are added to the layout with the right classes, and clicking next etc. calls setProps would be great.
Happy to give pointers on either of those if needed!
|
Hi @tcbegley I agree with all comments on the code - I'll make your suggested changes. I think it's not necessary to include the What do you think about using the examples in the demo app for the documentation? |
Ok perfect, I agree, let's not include them!
Yeah they look good actually, maybe just cross-reference to Bootstrap docs to make sure we're not missing any functionality, but it looks pretty complete! |
One functionality that is in the Bootstrap docs that is not included is the cross-fade animation (rather than the slide animation) when changing the slides. There is no prop for that in |
Sure why not! You could also submit a fix upstream in reactstrap if you fancy it! I did that a couple of times before when stuff wasn't supported. I don't think the different animation styles are so important though if either of those options are a hassle. |
|
It would be easy to add as an example in the docs. It looks like it will be added to |
tcbegley
left a comment
There was a problem hiding this comment.
This looks great! I have two minor queries, but otherwise I think this is basically good to go 🎉
|
For now, I also removed the example of formatting the prev and next controls with CSS, since that's not part of the official Bootstrap docs either. (Maybe because people don't do that very often?) If someone wants to change those, I think it would be easier to hide to Bootstrap prev/next controls, replace them with a |
tcbegley
left a comment
There was a problem hiding this comment.
Thanks @AnnMarieW! This is great 🚀
This PR adds a Carousel component -- as requested in #582
This is a work in progress and I hope this draft PR will make it easier to review different API options for the component.
Currently
dcc.Carouselis a single component. It's possible to create separate components for the captions and headings, but so far, I find it more intuitive to format a slide with all the options in one dictionary.When you have some time, it might be easier to run
carousel.py, then we can discuss in more detail.