Skip to main content
Question

Current best practices for creating components with dynamic children?

  • September 16, 2024
  • 1 reply
  • 78 views

cbasmajian

I’m porting an existing design system to Figma, and I’m wondering, what are the best practices in 2024 for building components with dynamic children? For example, a dropdown menu where one instance has options A, B, C, and another instance has options D, E, F, G, etc. Or, a resuable modal component.
Some UI Kits / design systems I’ve seen here require a component instance to be configured, then detached. Is this the standard approach?

This topic has been closed for comments

1 reply

Ashlee_Williams

What I’d do is create a dropdown component with the maximum possible number of options, then set a visibility variable on each option that allows them to be individually shown/hidden from each instance of the dropdown. That way if I only need options 1-6, I can turn off options 7-10.


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