question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

proposal(tabs): automatic tab width

See original GitHub issue

Summary

Permit me to propose an “auto tab width” property (false by default) that sets the width property of tab items to be “auto,” instead of having a maximum width of 10rem.

Justification

The main use case is for using the Tabs component in a narrow column (i.e. 4 columns or fewer). In the screenshot below, the tabs are contained in “4 columns”.

compare

Auto tab width with Carbon grid overlaid using the Carbon devtools Chrome extension:

compare-grid

Desired UX and success metrics

This feature would work best with 3 or fewer tabs, or with tabs with short labels.

Desired UX would be to have an autoWidth prop in the React library:

<Tabs>
  <Tab autoWidth label="Tab item 1" />
  ...
</Tabs>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
asudohcommented, Sep 25, 2020

Weighing in; IIRC the design decision was that “every tab should have the same width”, instead of “every tab’s width should be n em”. Given “every tab should have the same width” cannot be implemented for the width of arbitrary content, we set a specific width by default and let application override our style to set the width that accommodates their contents.

1reaction
emyarodcommented, Sep 24, 2020

I think that conclusion is logical but cc @aagonzales for some additional insight into Tabs usage guidelines!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tabs deep dive: anatomy of a tab - DocuSign
The Text tab above includes width and height properties that determine the size of the tab in pixels. The size of Sign Here...
Read more >
Add option to control tab width when viewing files - GitLab
Tabulation character ( 0x09 , \t ) is always rendered with a width of 8 spaces, but many projects use 4 spaces for...
Read more >
Variable width tabs (auto width) - css - Stack Overflow
I want the tabs to automatically adjust to the content within them, however I want them to have a max-width of 200px. I...
Read more >
Quick Tip: Working With Tabs in InDesign - Design & Illustration
The width of the frame is measured along the ruler and shows the available workspace for inserting tabs. If you change the frame...
Read more >
Eclipse Community Forums: C / C++ IDE (CDT) » Tab width?
> but tabs and automatic indentation are 4 spaces width. ... > doc. CDT version is 3.0. > Is it a bug? ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found