Components coupled by design #2506
Closed
oliverschuerch
started this conversation in
Ideas
Replies: 1 comment
-
We decided to not add thonse config files at the moment and instead add the component manually to the components-angular package. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As our component library grows, we come to a point, where it is not possible to add only one single component to solve every problem. Sometimes we need multiple components to create one specific experience.
In other words, we need to create multiple components to solve one specific problem.
Let me give you an example:
To create an accordion, we need a wrapper and some accordion-item components.
An accordion-item is getting the content who must be shown or hidden, dependant of the state of itself.
The accordion wrapper component manages all the events, which are coming from its accordion-items. For example if only one open accordion-item is allowed, it closes all the others, when the user is opening a new one.
This two component types are coupled by design and only work properly, if the other component is integrated correctly. So, if you enter an accordion wrapper component without an accordion-item, nothing will show up or work.
If you use multiple accordion-item without an accordion wrapper component, the accordion behavior will not work as expected.
The problem:
The only ones who know (for now) how to integrate these components are humanbeings and off course it is documented in storybook and manually set up in the component stories.
But as far as we want to create this components programmatically (for example to test them), we are not able to do so.
Approach:
This config json files are small and easy to create (when needed) and can be used to generate for example angular components in the components-angular package. As we might add more frameworks in the future, they could be useful for them as well.
Please share your thoughts!
Beta Was this translation helpful? Give feedback.
All reactions