Every component is isolated, which means it can be used in any of those applications or any of those other libraries. Now you can also have a simple decoupled code base. So you can literally say, okay, I'm gonna separate it out because you know you're scaling, team's getting bigger, and you want teams to own features. So you can have one team, base UI, this is your repo and these are your components. You're in charge of this and build your components and deploy your components when you want to. E-commerce team, here's your components, build your components, deploy your components and just work wherever and whenever you want to. And then your applications, there could be another team that owns specific applications and they can deploy their components in their application whenever they want to. As Bit versions each component and isolates each component it can then be used in any of those repos, installed into any of those and basically used across any repo.
So here's an example, this is my base UI, code base and VS code and you can see on line two, I'm importing the button as a component from this actual repo, right? From the base UI repo, so it's importing it instead of using a local import because every component is, you know, version and isolated, I need to like basically install it as if it's its own package. So I'm installing this button and using it inside this team toggler component. Now in my E-commerce application or actually this is not an application, it's just a load of E-commerce components but in this E-commerce repo, I'm actually installing that same button component. So here I'm installing the base UI from the base UI repo, the button, the card, the heading and a few others are coming from a different repo, the one I just showed you and it's also installing some components from this particular repo, from the E-commerce repo. So I can install components from any repo inside any of my repos and workspaces. So this allows me to have team ownership. I have my base UI team owning those components, owning that repo, I have my E-commerce team owning those and then I've got my perfume store, my show store, my sports stores, different teams owning those applications. And at all times, I can see which components are using which ones. So I can see that the base UI is being used by the E-commerce and it's also being used by these stores and the E-commerce is used by these ones and I can see at all times, who is using who, who's depending on who, who's its dependents are.
Now, each component in Bit, comes with some documentation and a live playground. So you can at all times, look at a component, see what it does, read about it, figure it out by basically saying, this is the component I want and you can kinda play around with it and see, so I can change anything in this and it will change live. I can update that text, I could see what it looks like with a longer text, with the text break, what have I added a really long price, et cetera, et cetera. I can also embed the Figma designs, direct inside the documentation of my component, which means I can at all times, see what my component should look like according to what the design was and I can easily just click on that Figma embed and it will open the Figma file directly, where I can then further explore the padding and spacing that the designer created for that particular component. I can create different states of the components, so different compositions and see what the component looks like if I was to add something specific in there, remove it and change it, modify it, et cetera. And I can view the component props, so the API of the component, I can see that this component accepts a button text, which means I know I can change that text of add to cart to be whatever I want. I can change the price, but as I can see from here, I can't change the currency, so gotta work in dollars if I wanna work with this component. I can change the source and the alt tag for the image and I can change the text, so at all times, I can see what I have access to, what the types are, as well, and a description of what these props are gonna do. Now I can easily have visibility and discoverability of my components. I can search for a component. For example, I'm looking for a product card, I wanna see if the one exists, and I can basically just search and here I can see I've got an entity product or I've got a product card or I've got a price that's in the folder of products, so I can see I'm looking for the product card and I've also got a grid of product cards, so this gives me an idea of what is available to me. Now I can also search across multiple scopes or multiple reports, so here are my components. I've got base UI components, I've got multiple scopes in here like the e-commerce, the shoe store, et cetera, and I can just search across it and I can search for a button.
Comments