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 not responsive #3298

Closed
Pithikos opened this issue Nov 28, 2024 · 5 comments
Closed

Tabs not responsive #3298

Pithikos opened this issue Nov 28, 2024 · 5 comments

Comments

@Pithikos
Copy link

Pithikos commented Nov 28, 2024

What version of daisyUI are you using?

4.10.1

Which browsers are you seeing the problem on?

Chrome

Reproduction URL

https://codepen.io/Nijoko/pen/BaExxeW

Describe your issue

In small screens, tabs seem to take a full width horizontally and go beyond the view of the screen.

        <div role="tablist" class="tabs tabs-bordered tabs-lg">
            <a role="tab" class="tab">Tab1</a>
            <a role="tab" class="tab">Tab2</a>
            <a role="tab" class="tab">Tab3</a>
            <a role="tab" class="tab">Tab4</a>
            <a role="tab" class="tab">Tab5</a>
            <a role="tab" class="tab">Tab6</a>
            <a role="tab" class="tab">Tab7</a>
        </div>

image

Copy link

Thank you @Pithikos for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

@saadeghi
Copy link
Owner

What is the expected behavior when there are this many tabs next to each other?

@Pithikos
Copy link
Author

I guess either similar to menu buttons - each tab button taking full width of screen, one under the other. Or alternatively break into enough lines to fit the contents (so in the example !Tab5" should have broke into a separate line).

@saadeghi
Copy link
Owner

This will be fixed in daisyUI 5 soon.

Until then, there are 3 options you can handle this situation:
https://play.tailwindcss.com/grQ7yiwpvS?size=362x720

My suggestion is the second one. It looks better on mobile.
But in general, I wouldn't put these many items next to each other for small screens.
It's better to use a dropdown or sidebar drawer or a vertical collapsible menu for mobile screens.

Let me know if you have a question.

@Pithikos
Copy link
Author

Thanks! Didn't really expect such a timely and full response. Really appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants