twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
169.97k stars 78.74k forks source link

Scrollable tabs on overflow #6770

Closed jumpinjackie closed 11 years ago

jumpinjackie commented 11 years ago

When a large set of tabs that displays fine on desktop/tablet resolution gets compressed down to a smartphone resolution, they flow over onto the space below producing an ugly set of stacked tabs.

What would be really nice is on such constrained displays, that the tab list becomes horizontally scrollable or vertically scrollable if the tab list is vertically oriented

Some screenshots to better explain

What currently happens

current-tabs

What we'd like to happen

desired-tabs

mdo commented 11 years ago

We won't be adding that at this time. I'd consider a different approach than tabs for narrow views.

ProLoser commented 11 years ago

What if you just have an optional class to make the tab bar fixed height and overflow:auto so that the tabs don't wrap. Then slap something like this in there: http://lea.verou.me/2012/04/background-attachment-local/ so that people can see that it's in fact possible to scroll through the tabs (or drag through them on touch devices). The arrows to scroll would of course be an additional feature.

I realize the flaw with this would be that it breaks dropdowns... still got no solution for that.

aolee commented 10 years ago

@jumpinjackie did you manage to solve this issue? i need the same thing for my project.

swapna5 commented 10 years ago

Is there any solution for this scrollable tabs?

jumpinjackie commented 10 years ago

@aolee Our workaround in our app was to use a TinyNav (http://tinynav.viljamis.com/) in place of the tabs when the screen gets small enough.

Still it's a hack.

Still I am disappointed that such an idea that would have merit when we're trying for a one-size-fits-all responsive design would be shot down like this.

Other options you may consider:

seiyria commented 9 years ago

For those looking this way, Polymer has support for this out of the box (thankfully).

marcelkohl commented 9 years ago

Maybe this can help: http://www.bootply.com/l2ChB4vYmC

twbs-lmvtfy commented 9 years ago

Hi @marcelkohl!

You appear to have posted a live example (http://s.bootply.com/render/l2ChB4vYmC), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:

You'll need to fix these errors and post a revised example before we can proceed further. Thanks!

(Please note that this is a fully automated comment.)