mui / mui-design-kits

The public feature and bug tracker for the MUI Design kits and Connect Figma plugin.
https://mui.com/design-kits/
97 stars 14 forks source link

Nesting Stacks - "Components can't contain instances of themselves" #345

Closed johnlahut closed 3 weeks ago

johnlahut commented 3 weeks ago

The problem in depth

Using the latest MUI for Figma, I am trying to design a UI using the design kit. The design requires me to use some nested Stack components.

When I add a Stack and then replace an instance of that Stack with another Stack, Figma gives an error "Components can't contain instances of themselves".

How can I put a Stack within a Stack using the design kit?

Your environment

No response

Search keywords: instances of themselves, figma

adrianmanea commented 3 weeks ago

Hi John, Figma doesn't allow nesting the same component instance on itself. As a workaround, you can try creating a new component that groups the items you want to include. Then, you can use this new component within your main component. This will give you more flexibility and maintainability in your design system.

johnlahut commented 3 weeks ago

@adrianmanea I see. Thanks for the help!