Hey, guys. I'm Xenonia, and welcome to the Lightning Talk. Today I'll be sharing with you regarding build your own component library with Shed CN view. I'm from Malaysia, and I'm the front-end lead at TroopFail Inc. I'm also the co-maintainer of RedixView and Shed CN view.
So, first of all, what is traditional component library? So essentially, I describe it as the component library that the component's API were designed, such as props, event, methods, and slots were designed by the author or the team itself. So I believe all of us has used component library before. Definitely, we will come across a few challenges. So, first of all, we are always limited to the exposed API. Be it exposed a thousand props or events, we always somehow limited. We just think at the bottom of our mind, I just wish that I could modify just something of that component.
Second challenge, we always find it hard to customize the styling, especially when we are using, let's say, Tailwind CSS or Uno CSS, we always need to force the important exclamation mark for the style, to assert the styling, because just the component library wasn't built around, wasn't designed to have inline classes styling.
Third of all, which is we always find it difficult to build a wrapper around it. So in my company, we were trying to build a design system, a component library around a component library, because we want to have different styling, different component behavior, as such, and we always find it so hard to do so. So I believe this problem has always been the case, until ShadCN arrives.
So this was, the project was initially released last year, on January, and since then, it has gained so much popularity in the React world, and it also affected the Vue, as well as Shelf world. So what is this ShadCN Vue? It is essentially a concept that for you to copy and paste accessible components into your project. And it solves all the problem that I mentioned earlier. How so? So I'm not going to talk about ShadCN UI, because that project is built for React. So let's look at ShadCN Vue, which essentially is the same idea, same concept, but it is a community viewport of ShadCN UI. And it is a collection of reusable components that you can copy and paste or use the CLI to add the components into your project. So it eliminates three of the problems just now. So we are no longer bound by the exposed API. So right now we are free to design the API however we like. So because all the components right now are in your project, you have the ownership of the component. So let's take a look at this button here. So you can add however, whatever props, events, slot props, however you want, anything you want into the button because right now you have ownership of that. Just design it as you see fit. Got it? Secondly, we always find it hard to customize styling and let's say the DOM positions of certain elements. No longer the case as well.
Comments