-
-
Notifications
You must be signed in to change notification settings - Fork 144
Conversation
I noticed that the changes to dash-core-components/test/test_integration.py Line 219 in 7b6b5ff
|
@kyleabeauchamp Good point - although the old integration tests aren't applicable here because I've changed the component API a bit, some integration testing with the new components would be nice! |
I have an open PR as well that attempts this, FWIW. |
This looks AWESOME! Thanks |
@kyleabeauchamp Whoops, sorry, didn't see your PR in time :) |
One more naive question: is rebuilding and committing bundle.js part of the PR process? I suspect that would facilitate testing this branch (for those of us too lazy to get a fully working dev environment). |
@kyleabeauchamp Good question - I wasn't sure about this (couldn't find any documentation about it) but I think you're right, looking back at older PR's it looks like the build is included, and I forgot to update the version as well, so I've now done that. Thanks for your help! :) |
This is beautiful. I'm a big fan of the dual component design. Great work! |
Thanks, with the latest commits I can now import the |
Hi @valentijnnieman ! I'm having an issue: when I select the tab for the first time, the layout is correct , but when I switch tabs and then return to it, the layout has been messed up: |
@valentijnnieman - I'm OK with these styles being merged into the defaults, but what I'm concerned about is that the selected styles seem to be mutated after I've clicked on them. Here is the same GIF but annotated: Step 2 - Click on Tab #3. Step 3 - Click on Tab #1. Note how Tab #3 now has a left and top border. It shouldn't have any borders, it should appear the same way as it appears in Step 1. It seems like the style is getting mutated rather than copied. Similarly, note how in Step 2, Tab #1 has left and top borders. This is unexpected, it shouldn't have any borders. Does that make sense or am I missing something here? |
@chriddyp Sorry, I missed that completely when watching your gif :) I'll take a look at it! |
@chriddyp I made a mistake where I copied the styles over - thus leaving styles that were being appended (from |
@lilianeolmos Hmm that's odd! I've just published prerelease version |
@valentijnnieman thanks for your answer. I've just tried and I'm still having the same problem. When I use the previous versions of dash_core_components this problem doesn't happen. |
@lilianeolmos Hmm! Would you perhaps create a post on our forums, here with a short reproducible example code of the bug? Would help us out a lot! |
Thanks for making this changes! Let's do this 😸 💃 💃 💃 |
@valentijnnieman is there a way to change the tab sizes/length? I have 4 and one is carrying over to a new row |
@danigallo You could specify the |
Thanks for all your work on the new Tabs functionality. My apps still use the old one from the 0.21.rc1 release and was wondering if it would be safe to switch over for my use case. Typically, each tab's content takes 20 seconds or so to load because of internal data fetching, computation and rendering of a complicated plotly Figure. Additionally, most tabs are never used during a given session, so the content never needs to be generated. Would the new component slow down the app? |
It will not, you can still use the previous method "generate content through a callback" with the new tabs component. This is what I recommend for most use cases. See the second example here: https://dash.plot.ly/dash-core-components/tabs |
Hi Fairly new to Plotly and Dash but loving what I can do with it so far! Have started experimenting with tabs and I have two tabs, but when I load my dashboard it opens my "second" tab as the first tab you see. Is there a way to set tab1 as the "default" tab that should be displayed first? Have done a fair bit of searching but can't see it covered anywhere. Thanks Chris |
@Chris3691 Yes there is. Look at the code example in this earlier comment where a bug (now resolved) was spotted with this default tab functionality. You'll see each |
We have published the documentation for this component online here: https://dash.plot.ly/dash-core-components/tabs. Many thanks to everyone who has contributed to this effort! If you have any other questions or issues with this component, please create a new issue or discuss in the community forum https://community.plot.ly/c/dash |
Hello there!


Here is the improved Tabs component I've been working on, branched off the current master branch. It supports className's and inline style's for the multiple containers (parent, tabs, tab, tab-content, tab--selected) which appends classes to the base classes (let me know if it should overwrite the default classes instead of appending) and has a
vertical
bool for rendering vertically.It's also more responsive:

It's basically 2 components: a
dcc.Tabs
component which is the container, where you can specifyvertical
and set some classes and styles, and adcc.Tab
component, which renders a tab with alabel
, and renders it'schildren
(which can be anything in Dash) when that tab isselected
! Thanks to @T4rk1n for his work and ideas!Here's an example of how to use Tabs:
I haven't included any builds yet, because I'm not sure if I should - CircleCI etc will handle that stuff, right?edit:
Please be aware that the component API has changed a bit - it now uses 2 components:
children
as tabs, complete with selection logic - you no longer have to set this up yourself in Dash, it's handled internally, which I hope is more easy to use. Would love to hear some feedback on this, especially if this is giving you trouble or prevents a certain use case for you.label
prop that holds the label of the tab's button, and renders it'schildren
as the content that will be visible when this tab is selected