Auto size with a complex background

I’m trying to do something rather complex and about 90% sure it isn’t possible with the current autolayout options.

I have this modal design. The background is a rather unique shape. I want the background to adjust when the internal container (dashed for demo) changes in size. I’ve set that as a slot that I can replace with different content.

The interior section will need to be adjustable, but the spacing is 48,8,8,8. The modal


Screen Shot 2021-12-23 at 4.23.43 PM

Hey @Tara_Price, you can’t do without hacks.
I made an example which you can see from the link below.

Design file:

Kinda but not quite. It looks like when the content grows, the angle of the blue will not adjust.

Right now I’m manually adjusting the size of the background portion. But I was hoping I was just missing something obvious.

Thanks for the attempt! :slight_smile:

Could you demonstrate how it should work?

I have the angle blue fill pinned to the top right corner. And the size of the modal is based on the size of the content I’m swapping out.

Here’s a proof of concept that I think covers your use case:

The main technique is hacky but I’ve used in production; it’s basically a fixed zero-height background anchored to the top right corner (with clip content turned off). The actual background is a component large enough to accommodate the widest size of your modal. (In theory, you could use an image for this background but it is not performant as an SVG).

Hope this helps!

Thanks @ntfromchicago for the help. The directions definitely solved my issue. It is hacky, but it’ll work for my master component. I was also able to put my header content in that top frame. So bonus!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.