Creating components extending from Shoelace #1559
lucasmaidanaglobant
started this conversation in
General
Replies: 2 comments 2 replies
-
Hi there! Shoelace components weren't designed to be wrapped/renamed/extended. You may have success with some components, but anything that uses or references other Shoelace elements will break. Some examples:
That said, extending/wrapping/changing tags wasn't a design goal of the project, and I don't see that changing in the near future. It would be better for you to fork the library or, even better, use it as-is. |
Beta Was this translation helpful? Give feedback.
1 reply
-
What about these two options:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! My team is building a components library wrapping some of the Shoelace components. We want to keep the same API for our wrappers so anyone can migrate seamlessly from Shoelace to our library.
We are trying to find the best way to pass all properties from the wrapper to the Shoelace component. And sometimes we need to override or add new properties. We want to avoid defining every property all over again and have less verbose code.
We thought about extending from Shoelace classes, or creating mixins or even spreading props in a React style.
Have you come up with other ways of extending from Shoelace components? Any idea helps
Beta Was this translation helpful? Give feedback.
All reactions