Skip to content
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

[Tabs] Width not fully functional #1203

Closed
inoc603 opened this issue Jul 19, 2015 · 7 comments
Closed

[Tabs] Width not fully functional #1203

inoc603 opened this issue Jul 19, 2015 · 7 comments
Labels
bug 🐛 Something doesn't work component: tabs This is the name of the generic UI component, not the React module!

Comments

@inoc603
Copy link

inoc603 commented Jul 19, 2015

I'm trying to set the width of tabs through tabWidth property of Tabs, as in the following code:

<Tabs tabWidth={75}>
  <Tab label='tab 1'>
    <h1>tab 1</h1>
  </Tab>
  <Tab label='tab 2' >
    <h1>tab 2</h1>
  </Tab>
</Tabs>

But in the rendered page, only the width of the ink bar under the tab is changed, and the actual tab's width didn't change. Any idea how to fix this?

@Zadielerick
Copy link
Contributor

@inoc603 That prop was not working with me either; The way I did it was, using the tabItemContainerStyle prop and passing the width of that. In your case, the width would be the total width of your tabs, so if each is 75px, then 75 x 3 = 225. So, pass:
< Tabs tabItemContainerStyle={{width: 225}} > ... etc and it will resize the tabs so that they all have an equal length of 75px

@inoc603
Copy link
Author

inoc603 commented Jul 21, 2015

@Zadielerick Thanks for the solution. It works like a charm.

Though I think the tabs should resize themselves, if tabWidth is specified and the total width of the tabs does not overflow the container. May be should make a PR to fix this?

@Zadielerick
Copy link
Contributor

@inoc603 Yeah, I have been working on fixing the Tab and Tabs, and I noticed that it has that prop that doesn't really work and styling them is tedious, so that may be the next thing that will be fixed in them. #1166

@shaurya947
Copy link
Contributor

PR #1232 was merged to address this. The Tab component has a width prop -- I bet that would work for your use case @inoc603. The Tabs component no longer has a tabWidth prop, perhaps removed in favor of the finer control over each tab using the width prop. Closing for now.

@aweary
Copy link
Contributor

aweary commented Dec 1, 2015

@shaurya947 the width property on <Tab> doesn't seem to do anything. It looks like the width of the tab is being calculated by the <Tabs> component instead. We're looking to have our tabs at a width of ~200px and aligned to the left, not centered and stretched to the full width of the page, and it doesn't seem to be working.

@kevinsproles
Copy link

+1 on the width property on <Tab> being needed. We're looking for each tab to be the same width as the text label for that tab.

@alitaheri alitaheri added the bug 🐛 Something doesn't work label Dec 8, 2015
@tintin1343 tintin1343 added new feature New feature or request bug 🐛 Something doesn't work and removed bug 🐛 Something doesn't work new feature New feature or request labels Apr 26, 2016
@oliviertassinari oliviertassinari changed the title Tab width not fully functional [Tabs] Width not fully functional Sep 17, 2016
@oliviertassinari oliviertassinari added the component: tabs This is the name of the generic UI component, not the React module! label Oct 19, 2016
@oliviertassinari
Copy link
Member

The tabWidth property was removed from the component. I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: tabs This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

8 participants