Skip to main content
Question

Advice on Responsive Avatar Component with Min/Max Width Constraints

  • October 27, 2024
  • 0 replies
  • 26 views

Zara_Pokrandt1

I’m designing an avatar component that needs to be responsive to varying text lengths. The component includes:

  • An avatar image,
  • Job site,
  • User’s assigned role,
  • An icon button for a dropdown menu.

I want the component to:

  1. Resize based on text length, with a minimum and maximum width.
  2. Truncate text once the maximum width is reached, but hug the text until then.

Currently, I’ve set up Auto Layout for responsive resizing and am using “Hug contents” for initial flexibility. I’m experimenting with a nested frame to enforce the max-width and have applied truncation to the text, but I’d love insights from anyone who’s successfully implemented similar constraints in their designs.

Any tips or recommendations for better handling this setup? Thanks in advance for your advice!

This topic has been closed for replies.

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings