Skip to main content

Installing Components

Once you have exported your component you can install it in another Bit workspace or in any other web project.


Installing your component#

Component 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 install @bit/YourUserName.componentScopeName.componentID

➡️ Learn more about Installing Components.


Configure your Scoped Registry#

To 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 Component#

You can now use the component in your app by importing it from your node modules and then using it in your app or component.

app.js
import { Button } from '@yourUserName/componentScopeName.componentID';
app.js
...<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.