I’ve been using components a looot creating a design system for the company I’m working and there were a lot of cases where I found would be useful to have my components inheriting some variant/variable. Here are some examples:
Inherit style
I would like to put a button and not worry if it is a normal/success/danger button. I should put at the parent container some variable Style: danger and then have all components that have the Style property update automatically.
Inherit theme
Similar to the example above, it would be nice if you could have the parent container with a Theme property and then this would cascade down to all components that also have this property, so creating Light/Dark themes would be faster.
Inherit small properties
There’s a button component with an Icon Slot, this icon should have a default size of 24px but every time I update the icon the value resets to the default icon size (instead of the icon size ON THE BUTTON). In this case, the Size property on the icon should inherit a Size property on the button (or on the Icon slot)
Inherit logic
There are cases where you have a main variable to the whole frame, for example: “Logged in/Logged out”, but only a few components would change by this variable. That way instead of duplicating the frame/big component and then manually changing the variant for every small component you would only input the information once on the parent container and the logged in/logged out variable would cascade down to all components automatically.
I know this isn’t really a dealbreaker, but I can see how this could open endless possibilities and at the same time boost productivity for larger and complex projects.
Do you guys have faced any similar situations before?