Installing Components
Once you have exported your component you can install it in another Bit workspace or in any other web project.
#
Installing your componentComponent packages are installed using their package name. The package name usually correlates to the component ID.
In your component workspace click on the Use dropdown, select the Install tab to copy your component scope name and component ID. You can then choose between NPM or Yarn to install your component in to another Bit workspace or into a React application.
- NPM
- Yarn
npm install @orgName/componentScopeName.componentID
yarn add @orgName/componentScopeName.componentID
➡️ Learn more about Installing Components.
#
Configure your Scoped RegistryTo install components with npm or yarn you might need to configure @YourUserName as a scoped registry.
npm config set '@YourUserName:registry' https://node.bit.dev
#
Use your ComponentYou can now use the component in your app by importing it from your node modules and then using it in your app or component.
import { Button } from '@yourUserName/componentScopeName.componentID';
...<Button>click Here</Button>...
#
What's Next?We have just covered the basics and there is still so much to learn. Now it's time to really think about how you can use Bit to its full advantage. Learn more about What Bit is and the Advantages of Bit or Dive deeper into our Building with Bit section and learn how to configure Bit.