Skip to content

Conversation

aduth
Copy link
Contributor

@aduth aduth commented Jun 7, 2023

Summary

Improve appearance of segmented button text wrapping. When segmented button group text wraps, the height of all buttons will now update to match.

Preview link

Local storybook link: http://localhost:6006/?path=/story/components-button-group--test-text-wrapping

Problem statement

Currently, if a segmented Button Group includes buttons with text long enough to wrap, only the button with the longer text will wrap, which prevents the segmented group from appearing as a single grouped collection. This is particularly noticeable at small viewport sizes.

Example: 18F/identity-idp#8542

Solution

Add flex and grid styling to force buttons to grow together and align text as vertically centered.

This is not intended to have any other visual impact on the current appearance of segmented buttons beyond text wrapping.

Before After
localhost_6006__path=_story_components-button-group--test-text-wrapping localhost_6006__path=_story_components-button-group--segmented

Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting inconsistent results with multiple line break buttons above mobile-lg (480px).

Screenshot 2023-07-26 at 10 49 20 AM Screenshot 2023-07-26 at 10 52 55 AM

It does look great on smaller sizes or where the text doesn't break

Screenshot 2023-07-26 at 10 54 10 AM

@aduth
Copy link
Contributor Author

aduth commented Sep 6, 2023

Hey @mahoneycm , apologies for the delayed response. Just wanted to drop a note that I've seen your feedback, but have been rather busy to take a look. I'll plan to try to find a fix for large viewport styling when time permits. (Or I'm also totally okay with pushes directly to my branch!)

@mejiaj
Copy link
Contributor

mejiaj commented Dec 5, 2023

Thanks for submitting this! Closing in favor of #5657, which is an extension of this work.

@mejiaj mejiaj closed this Dec 5, 2023
@aduth aduth deleted the aduth-segmented-button-text-wrap branch December 5, 2023 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants