Add items to autolayout in component instances

We often have the problem that we don’t know how many items we should include in a component, for example a toolbar. We often end up adding some hidden extra buttons.

This works, but it has some really annoying downsides:

  • We have to guess a good maximum number of items
  • We have to detach if we want to add more
  • We cannot handle separators in a good way, other than adding them everywhere and hiding them
  • It’s way too difficult to reorder items

I suggest that autolayouts can have a property that allows for adding more items of a specified type (with reordering). Then we would be able to make our components much more simple and flexible.

4 Likes

Yes, it is baffling that this isn’t possible. I made a component for panels our app uses which allows me and my team to add a correctly sized and formatted panel really easily. That’s great. But that panel has a frame inside it to hold content (which could be any number of checkbox/radio button settings, text, input fields, dropdowns, etc. The only way I can actually use my instance is to detach it from the main component, which pretty much obviates up the whole point of using components in the first place.

Why can’t it just treat everything in the frame like a black box so all it maintains is the frame setting w/o caring about what contents are inside of it?

1 Like

Really looking forward to something the thread author shared. Would be way more dynamic than what we currently have.
Our team is using the slot method to have at least a bit of flexibility regarding item count but it’s far from perfect as it comes with the already mentioned downsites and limitations. Also: Once slots are filled/swapped with components, you can’t reduce the item count via property dropdown menu and need to hide each element by hand.
See:
slotgroup

You need to assemble the component correctly. This is the structure it should be:

Slot group
    Container 1 (visible true or false)
        Slot
    Container 2 (visible true or false)
        Slot
    …
1 Like

Brilliant! Thanks a lot Yury