Skip to content

Feature request: add responsive btn-group-vertical classes #39213

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

Open
2 tasks done
Rabadash8820 opened this issue Sep 20, 2023 · 1 comment
Open
2 tasks done

Feature request: add responsive btn-group-vertical classes #39213

Rabadash8820 opened this issue Sep 20, 2023 · 1 comment
Labels

Comments

@Rabadash8820
Copy link

Rabadash8820 commented Sep 20, 2023

Prerequisites

Proposal

Add responsive btn-group-* and/or btn-group-*-vertical classes, that cause a btn-group to appear vertical or horizontal at the specified breakpoints (sm, md, etc.).

Motivation and context

btn-group is a handy component for visually/connecting multiple buttons. However, if there are lots of buttons with text (especially when using btn-group-lg), then the buttons will be awkwardly squished together.

For example, here is a 3-button group on a widescreen laptop:

image

and again on a mobile screen:

image

btn-group-vertical looks much nicer on mobile, but leads to a lot of unnecessary surrounding whitespace on widescreen:

image

This SO answer with over 70 upvotes suggests using btn-group flex-wrap. However, this makes the button corners look weird on mobile without several additional border-radius-* utilities:

image

I could also use block buttons, but they lack the nice connected borders of a button group.

Long story short, if I could just put btn-group-vertical btn-group-md on my button groups so that they start vertical on mobile and then expand to horizontal on md breakpoints and above, it would make everything so much easier.

Edit: I know the proposed classes would conflict with the existing btn-group-lg and btn-group-sm classes for sizing... I don't have a great solution to suggest for that, other than making a breaking change or introducing more verbose classes like btn-group-sm-horizontal.

Rabadash8820 added a commit to Rabadash8820/Dansite that referenced this issue Sep 20, 2023
It wastes a fair bit of whitespace on wide screens, but there's no good way to make btn-group responsive that I've found (see twbs/bootstrap#39213)
Rabadash8820 added a commit to Rabadash8820/Dansite that referenced this issue Sep 21, 2023
It wastes a fair bit of whitespace on wide screens, but there's no good way to make btn-group responsive that I've found (see twbs/bootstrap#39213)
@mdo mdo added the stale Closed as stale label Apr 10, 2025
@mdo mdo closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2025
@Rabadash8820
Copy link
Author

@mdo I realize that this Issue is old and relatively unnoticed by the community, but I'd like to argue that it is still an Issue that should be fixed eventually. The current behavior is rather poor for responsive button groups with many buttons. I request re-opening this one . 🙏

@mdo mdo reopened this Apr 11, 2025
@mdo mdo removed the stale Closed as stale label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants