-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Updating TabPanel #42320
Comments
I think we can use the designs from #41904 (comment) here. And to answer my own questions in the OP:
I think so. Given the active indicator we use the tab UI looks a bit unfinished without it. We'll need to update current implementations where the border is added ad hoc (Inspector and Inserter).
It would be nice if there was a way to do this in a context-aware manner, but I appreciate that might be difficult. Alternatively perhaps we can make it possible to pass a spacing preset to the tabpanel and use that as an offset (negative margin).
We might do something similar to the previous point – if the tabpanel margin is offset, offer a way to add the offset to the padding.
Tabs within tabs are uncommon (not sure we have any instances of this in the UI currently), so we probably don't need to prioritise this. |
This may be edge cases, but I'll mention #33108 because it may be a good idea to consider cases where the tab panel has long text. |
That's a good consideration, thanks. Double-tabbing is also a problem, but I am concerned that in the case of a block with many items, there is a high possibility that users will not be able to see the tabs when loading the page and will get lost in the operation. At least I was lost in the operation even though I knew it was tabbed. Perhaps it would be better to be fixed at the top when scrolled. |
Since tablists aren't really designed to be stacked vertically, we should ideally reconsider whether it's a good idea to nest tabs in the first place. Has this problem been discussed before, @jameskoster? Another way around it could be to make the nested tabpanel a separate scrolling container, but that's probably not a silver bullet either: |
Making the settings/appearance tabs I agree that visually stacked tablists look a bit awkward. I haven't seen any explorations around how to address that yet. |
Thank you for considering my opinion. However, I would like to avoid the fact that the functions are buried and users do not notice them. |
I misread this to mean individually scrolling sections within the container. But if the container itself scrolled that might work. It's worth a try imo. |
Now that TabPanel usage is on the verge of becoming a little more widespead across the Editor (see #38277 (comment) and #41937), it's a good time to consider some aspects of the component design:
TabPanel on Storybook.
Additional to the examples listed above, the most prominent instances of this component paint a border beneath the tabs:
However, the default styling of the component does not include this border. Adding this same style manually across multiple instances is obviously not ideal.
With these new applications we also find situations where Tabs exist within the panels of other Tabs, and in other panels like the color picker. So a question arises about whether there should be a style variant that resembles hierarchy.
Lastly we might consider the layout as well. In particular; should tabs fill their container horizontally? How can we make the panel padding elegantly match the parent container padding, or should the panel padding always be static?
TLDR:
It would be nice if we can avoid ad hoc style overrides when using TabPanel.
cc @WordPress/gutenberg-design
The text was updated successfully, but these errors were encountered: